public LocationMappingProfile() { CreateMap <LocationCreateUpdateModel, LocationModel>() .ForMember(x => x.Type, opt => opt.MapFrom(m => MappingProfileExtensions.GetWellKnownTagModel(m.Type))); CreateMap <LocationModel, LocationDto>(); CreateMap <LocationDto, LocationModel>(); }
public AnimalMappingProfile() { CreateMap <AnimalModel, AnimalDto>(); CreateMap <AnimalDto, AnimalModel>(); CreateMap <AnimalCreateUpdateModel, AnimalModel>() .ForMember(x => x.Tags, opt => opt.MapFrom(m => MappingProfileExtensions.StringSeparatedSemicolomnToList(m.Tags))) .ForMember(x => x.Status, opt => opt.MapFrom(m => MappingProfileExtensions.GetWellKnownTagModel(m.Status))) .ForMember(x => x.ImageIds, opt => opt.MapFrom(m => MappingProfileExtensions.StringSeparatedSemicolomnToList(m.PreviousImageIds))); CreateMap <AnimalCreateUpdateModel, AnimalDto>() .ForMember(x => x.Tags, opt => opt.MapFrom(m => MappingProfileExtensions.StringSeparatedSemicolomnToList(m.Tags))); }
protected void CreateMapFor <TCreate, TUpdate, TInfo, TDto>() where TCreate : BaseCreateModel where TUpdate : BaseUpdateModel where TInfo : BaseInfoModel where TDto : BaseCommonDto { CreateMap <TInfo, TDto>(); CreateMap <TDto, TInfo>(); CreateMap <TCreate, TInfo>() .ForMember(x => x.Tags, opt => opt.MapFrom(m => MappingProfileExtensions.StringSeparatedSemicolomnToList(m.Tags))); CreateMap <TUpdate, TInfo>() .ForMember(x => x.Tags, opt => opt.MapFrom(m => MappingProfileExtensions.StringSeparatedSemicolomnToList(m.Tags))); CreateMap <TUpdate, TDto>() .ForMember(x => x.Tags, opt => opt.MapFrom(m => MappingProfileExtensions.StringSeparatedSemicolomnToList(m.Tags))); CreateMap <TCreate, TDto>() .ForMember(x => x.Tags, opt => opt.MapFrom(m => MappingProfileExtensions.StringSeparatedSemicolomnToList(m.Tags))); }
public RequestMappingProfile() { CreateMap <RequestModel, RequestDto>(); CreateMap <RequestDto, RequestModel>(); CreateMap <RequestCreateUpdateModel, RequestModel>() .ForMember(x => x.Case, opt => opt.MapFrom(m => MappingProfileExtensions.GetWellKnownTagModel(m.Case))) .ForMember(x => x.Status, opt => opt.MapFrom(m => MappingProfileExtensions.GetWellKnownTagModel(m.Status))) .ForMember(x => x.AnimalState, opt => opt.MapFrom(m => MappingProfileExtensions.GetWellKnownTagModel(m.AnimalState))) .ForMember(x => x.PersonState, opt => opt.MapFrom(m => MappingProfileExtensions.GetWellKnownTagModel(m.PersonState))) .ForMember(x => x.KindOfAnimal, opt => opt.MapFrom(m => MappingProfileExtensions.GetWellKnownTagModel(m.KindOfAnimal))); CreateMap <RequestCreateUpdateModel, RequestDto>() .ForMember(x => x.Case, opt => opt.MapFrom(m => MappingProfileExtensions.GetWellKnownTagModel(m.Case))) .ForMember(x => x.Status, opt => opt.MapFrom(m => MappingProfileExtensions.GetWellKnownTagModel(m.Status))) .ForMember(x => x.AnimalState, opt => opt.MapFrom(m => MappingProfileExtensions.GetWellKnownTagModel(m.AnimalState))) .ForMember(x => x.PersonState, opt => opt.MapFrom(m => MappingProfileExtensions.GetWellKnownTagModel(m.PersonState))) .ForMember(x => x.KindOfAnimal, opt => opt.MapFrom(m => MappingProfileExtensions.GetWellKnownTagModel(m.KindOfAnimal))); }