Search for both LeafInput and LeafInputData

This commit is contained in:
2023-02-02 09:35:22 -05:00
parent 8e16510ad9
commit 680f139aa5
24 changed files with 808 additions and 281 deletions
+12
View File
@@ -59,6 +59,18 @@ namespace LeafWeb.WebCms.App_Start
//System.Collections.Generic.HashSet`1[LeafWeb.Core.Entities.LeafInputDataCurve]"}
Mapper.CreateMap<ICollection<LeafInputDataCurve>, LeafInputData>()
.ForAllMembers(opt => opt.Ignore());
Mapper.CreateMap<LeafInputData, LeafDataResultViewModel>()
.ForMember(dest => dest.SiteId, opt => opt.MapFrom(lid => lid.Site.SiteId))
.ForMember(dest => dest.SpeciesSampled, opt => opt.MapFrom(lid => lid.Site.SpeciesSampled))
.ForMember(dest => dest.Latitude, opt => opt.MapFrom(lid => lid.Site.Latitude))
.ForMember(dest => dest.Longitude, opt => opt.MapFrom(lid => lid.Site.Longitude))
// TODO: Change to range?
.ForMember(dest => dest.CO2S, opt => opt.MapFrom(lid => lid.Data.Max(d => d.CO2S) - lid.Data.Min(d => d.CO2S)))
.ForMember(dest => dest.PARi, opt => opt.MapFrom(lid => lid.Data.Max(d => d.PARi) - lid.Data.Min(d => d.PARi)))
.ForMember(dest => dest.Tleaf, opt => opt.MapFrom(lid => lid.Data.Max(d => d.Tleaf) - lid.Data.Min(d => d.Tleaf)))
.ForMember(dest => dest.PhiPS2, opt => opt.MapFrom(lid => lid.Data.Max(d => d.PhiPS2) - lid.Data.Min(d => d.PhiPS2)))
;
}
}
}