You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
The documentation says that you can use UseNameSuffix and UseNamePattern for a specific source and target like so :
varanonSource=new{_PriceValue=default(double)};Mapper.WhenMapping.From(anonSource)// Apply to this anon type's mappings.ToANew<Product>()// Apply to Product creations.UseNamePattern("^_(.+)Value$");// Match '_PriceValue' to 'Price'
However when I try it it does not seem to be implemented.
Here is an example of code that I expected to work but UseNameSuffix is not recognized :
Thanks for raising this - apparently I missed it! You can configure type-specific naming patterns inline, but not using the static API. I'm working on it and it's proving a bit tricky, but I'll get it sorted out and will report back.
That was more complex than maybe it should have been, but it's done! The latest v1.6 branch code includes:
varanonSource=new{_PriceValue=default(double)};Mapper.WhenMapping.From(anonSource)// Apply to this anon type's mappings.To<Product>()// Apply to Product mappings.UseNamePattern("^_(.+)Value$");// Match '_PriceValue' to 'Price'
...release to follow. It only exists on the .From<>().To<>() API - not .From<>().ToANew<>(), etc - so you can't have different naming patterns for object creations and updates, for example.
Hi,
The documentation says that you can use
UseNameSuffix
andUseNamePattern
for a specific source and target like so :However when I try it it does not seem to be implemented.
Here is an example of code that I expected to work but
UseNameSuffix
is not recognized :Am I missing something ?
Thank you.
The text was updated successfully, but these errors were encountered: