문제

이 구성을 사용하면 Emitmapper 샘플에서 FlatteringConfig를 사용할 때 사용자 정의 변환기의 어떤 이유로 사용자 정의 컨버터의 기능이 호출되지 않습니다.DefaultMapConfig가 사용될 때 호출됩니다.

구성 :

    var userMapper = ObjectMapperManager.DefaultInstance.GetMapper<User, UserModel>(
                   new FlatteringConfig().ConvertGeneric(typeof(IList<>), typeof(IList<>),
                new DefaultCustomConverterProvider(typeof(EntityListToModelListConverter<,>))));
.

잠재적 인 이유에 대한 아이디어가 있습니까?

용액

아래의 답변을 봅니다

도움이 되었습니까?

해결책

Because FlatteringConfig overrides GetMappingOperations function it is not calling FilterOpertations functions, which assigns custom converters. So adding FilterOperations function call to the GetMappingOperations solved the problem.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top