示例#1
0
        public void Setup(UserEmailResolver userEmailResolver)
        {
            CreateMap <UserModel, User>()
            .ForMember(dest => dest.Id, opt => opt.Ignore());
            CreateMap <User, UserModel>();

            CreateMap <AccountModel, Account>()
            .ForMember(dest => dest.Id, opt => opt.Ignore());
            CreateMap <Account, AccountModel>()
            .ForMember(dest => dest.Email, opt => opt.MapFrom(userEmailResolver));
        }
示例#2
0
 public AutoMapperProfile(UserEmailResolver userEmailResolver)
 {
     Setup(userEmailResolver);
 }