Show extensions of ValueTransformerConfiguration#3
Open
TylerCarlson1 wants to merge 1 commit intojbogard:ValueTransformersfrom
Open
Show extensions of ValueTransformerConfiguration#3TylerCarlson1 wants to merge 1 commit intojbogard:ValueTransformersfrom
TylerCarlson1 wants to merge 1 commit intojbogard:ValueTransformersfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Main change to look at is in ValueTransformerConfiguration.cs file. Other changes were trying to get this to work with the ToType to extension method thing.
So idea is can make own implementations and can add them using extension methods. That way you aren't limited to
ApplyTransform<T>and can't do more sophisticated filtered transforms.Other way is remove the interface and have ValueTransformerConfiguration have
Func<object,bool>or something along those lines. Then have the extension methods of ApplyTransform ValueTransformerConfigurationExtensions passing in different kinds of Functions into the constructor.If there's like 3+ different version of ApplyTransform that would be 9+ ApplyTransform functions that would need to be generated. It would be a lot easier to maintain and see what they are if they were all in a single class close to the implementation of it. Instead of having to update the Interfaces and Implementations of 4-6 classes per new function generated (18+ functions in 6 files).
IMappingExpression<TSource, TDestination>doesn't work well with this and I don't know how to ignore adding the types explicitly for Generics, but the point was to show what it would look like if you were to do something like this.