Open anotowski opened 1 year ago
Hello @anotowski As far as I understand while working on open Issue. The Mapster is a Type Orientet mapper, not a dependency injector. Therefore, in order to successfully build a matching function, all dependencies must be resolved before transferring to Mapster. Otherwise there is simply nothing to analyze) If you need validation, then make a decorator or a special class that does two steps: 1) Performs your verification of the source. If successful step 2 2) Calls the mapper for the Source and Destination Target types
Or You must explicitly register SomeClassMaps implementation to the standard interface in the builder container.
Hello,
I'm struggling to register a mapster configuration using .Scan function from Mapster DI. I have a specific date time parser that I want to assure that all strings are parsed from a specific format:
As you can see I have interface so that I register Interface using autofac via assembly scan:
And that works fine, I can use this IDateTimeParser anywhere when I want, except the place that I have my map:
As you can see for now I have to expose default constructor and use tight coupling to be able to use my parser. How can I get rid of tight coupling in such case?
If I will comment out that TODO ctor I get an error that stops starting application:
Registration of maps looks like this: