增加可选参数,忽略视图模型NUll列更新

This commit is contained in:
2022-04-15 13:32:40 +08:00
parent 3ea3bcf256
commit f09954686b
4 changed files with 24 additions and 5 deletions
@@ -41,7 +41,7 @@ namespace IRaCIS.Core.Application.AutoMapper
CreateMap<Trial, TrialSurveyInitInfo>()
.ForMember(d => d.Sponsor, u => u.MapFrom(s => s.Sponsor.SponsorName))
.ForMember(d => d.IndicationType, u => u.MapFrom(s => s.IndicationType.Value))
.ForMember(d => d.TrialSiteSelectList, u => u.MapFrom(s => s.TrialSiteList))
.ForMember(d => d.TrialSiteSelectList, u => u.MapFrom(s => s.TrialSiteList.Where(t=>t.TrialSiteCode.Length>0)))
.ForMember(d => d.TrialId, u => u.MapFrom(s => s.Id));
CreateMap<TrialSite, TrialSiteForSelect>()