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)); }
public AutoMapperProfile(UserEmailResolver userEmailResolver) { Setup(userEmailResolver); }