automapper-9

Automapper AddAfterMapAction not calling method

生来就可爱ヽ(ⅴ<●) 提交于 2020-03-25 17:34:08
问题 I am using global configuration for Automapper profile mapping. public class StudentProfile : Profile { public StudentProfile() { CreateMap<Student, StudentVM>() .ForMember(dest => dest.school, src => src.Ignore()); } } Mapper Configuration public static class Configuration { public static IMapper InitializeAutoMapper() { MapperConfiguration config = new MapperConfiguration(cfg => { cfg.AddProfile(new StudentProfile()); }); config.AssertConfigurationIsValid(); return config.CreateMapper(); }

Automapper Not Mapping mapping properties

你说的曾经没有我的故事 提交于 2020-03-05 00:23:36
问题 I was working on Generics and I got stuck into weird issue. I am facing issue with AutoMapper-9 mapping. I have implemented ICollection but Automapper is not mapping the properties correctly. My code is CollectionBase class which is implementing ICollection public class CollectionBase<T> : ICollection<T> { ICollection<T> _items; public CollectionBase() { _items = new List<T>(); } protected CollectionBase(ICollection<T> collection) { // Let derived classes specify the exact type of ICollection