Search for both LeafInput and LeafInputData
This commit is contained in:
@@ -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)))
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user