Пример #1
0
 public PropertyQueryResult(string organisationalUnitId, List <PropertyQueryResultForPeriod> periodValues, int?periodToUse = null)
 {
     OrganisationalUnitId = organisationalUnitId;
     PeriodValues         = periodValues;
     PeriodToUse          = PeriodValues.Where(p => p.Period == periodToUse && p.Values.Any(v => v.Value != null)).FirstOrDefault() ??
                            PeriodValues.OrderByDescending(p => p.Period).Where(p => p.Values.Any(v => v.Value != null)).FirstOrDefault();
 }
 public PropertyQueryResult(string organisationalUnitId, List<PropertyQueryResultForPeriod> periodValues, int? periodToUse = null)
 {
     OrganisationalUnitId = organisationalUnitId;
     PeriodValues = periodValues;
     PeriodToUse = PeriodValues.Where(p => p.Period == periodToUse && p.Values.Any(v => v.Value != null)).FirstOrDefault() ?? 
                   PeriodValues.OrderByDescending(p => p.Period).Where(p => p.Values.Any(v => v.Value != null)).FirstOrDefault();
 }