We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initMaps,但原有类型会丢失,自定义设置CustomMapper item.CustomMapper!=null 重新init item.CustomMapper==null
The text was updated successfully, but these errors were encountered:
请提供代码示例让我重现BUG
Sorry, something went wrong.
代码在这里,https://github.com/kaanid/custommapper 请看一下。谢谢
已解决,下面是修改的部分,已推送Nuget /// <summary> /// 初始化映射配置 /// </summary> private static void InitMaps( Type sourceType, Type destinationType ) { try { var maps = Mapper.Configuration.GetAllTypeMaps(); ClearConfig(); Mapper.Initialize( config => { config.CreateMap( sourceType, destinationType ); } ); foreach( var map in maps ) Mapper.Configuration.RegisterTypeMap( map ); } catch( InvalidOperationException ) { Mapper.Initialize( config => { config.CreateMap( sourceType, destinationType ); } ); } }
/// <summary> /// 初始化映射配置 /// </summary> private static void InitMaps( Type sourceType, Type destinationType ) { try { var maps = Mapper.Configuration.GetAllTypeMaps(); ClearConfig(); Mapper.Initialize( config => { config.CreateMap( sourceType, destinationType ); } ); foreach( var map in maps ) Mapper.Configuration.RegisterTypeMap( map ); } catch( InvalidOperationException ) { Mapper.Initialize( config => { config.CreateMap( sourceType, destinationType ); } ); } }
棒
No branches or pull requests
initMaps,但原有类型会丢失,自定义设置CustomMapper
item.CustomMapper!=null
重新init
item.CustomMapper==null
The text was updated successfully, but these errors were encountered: