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
I'd expect configuration validation to fail, but we only observe an exception then executing the actual mapping
[Fact]publicvoidShould_Validate_Type_Mapping(){varconfig=new TypeAdapterConfig();
config.ForType<Source,Destination>().Map(dest => dest.Number,source => source.Time);// Does not throw
config.Compile();varsource=new Source
{Time= DateTime.UtcNow,};// Actually throws System.InvalidCastException : Invalid cast from 'DateTime' to 'Int32'.varresult= source.Adapt<Destination>(config);}
Is there some kind of configuration switch, that would allow us to validate matched types? We've switched from Automapper and would like to catch invalid mappings without writing tests for all of them.
The text was updated successfully, but these errors were encountered:
For the following classes
I'd expect configuration validation to fail, but we only observe an exception then executing the actual mapping
Is there some kind of configuration switch, that would allow us to validate matched types? We've switched from Automapper and would like to catch invalid mappings without writing tests for all of them.
The text was updated successfully, but these errors were encountered: