I've read this page, but it didn't have the answer. https://github.com/MapsterMapper/Mapster/wiki/Ignoring-members
What I want is to ignore all Id
fields when the Source type is named like SomethingDto
or FooDto
Something like this...
TypeAdapterConfig<TSource, TDestination>
.NewConfig()
.IgnoreIf((src, dest) => src.GetType.Name.EndsWith("Dto"), dest => dest.Id);
Another question, how could I set a global type mapping, then in the middle of a method, start using this new one and when the method ends, it reverts back to the original global setting? I might not want to always ignore Ids, for example.