aw6373: read organic matter from eurofins if available
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
This commit is contained in:
@@ -217,7 +217,15 @@ namespace FarmMapsAPI.Carbon
|
||||
{
|
||||
string provinceCode = GetProvinceCode(dataTransformationSet, postalCode);
|
||||
var crpYield = cropYieldConfig.SingleOrDefault(x => x.CropName.ToLower() == cropCode.ToLower());
|
||||
if (crpYield == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
var crpYieldProvince = crpYield.Yields.SingleOrDefault(x => x.ProvinceCode == provinceCode);
|
||||
if (crpYieldProvince == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
var cropYield = crpYieldProvince.YearData.SingleOrDefault(x => x.Year == year)?.YieldValue;
|
||||
return cropYield;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user