Skip to content

Show extensions of ValueTransformerConfiguration#3

Open
TylerCarlson1 wants to merge 1 commit intojbogard:ValueTransformersfrom
LuckyPennySoftware:ValueTransformExtensions
Open

Show extensions of ValueTransformerConfiguration#3
TylerCarlson1 wants to merge 1 commit intojbogard:ValueTransformersfrom
LuckyPennySoftware:ValueTransformExtensions

Conversation

@TylerCarlson1
Copy link

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.

@lbargaoanu lbargaoanu deleted the ValueTransformExtensions branch July 10, 2018 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant