示例#1
0
        public double GetAverageEnergy(DateTime startFrom, DateTime endBy)
        {
            var resultObservations = _observations.Where(x => x.ObservationTime > startFrom && x.ObservationTime < endBy).ToList();

            return(resultObservations.Sum(x => x.EstimatedValue) / resultObservations.Count());
        }
示例#2
0
 public double GetAverageEnergy(DateTime startFrom, DateTime endBy)
 {
     return(_energyObservationStorage.Where(e => e.ObservationTime >= startFrom && e.ObservationTime <= endBy)
            .Average(e => e.EstimatedValue));
 }
示例#3
0
 public double GetAverageEnergy(DateTime startFrom, DateTime endBy)
 {
     return(_observationStorage.Where(obs => obs.ObservationTime >= startFrom && endBy >= obs.ObservationTime)
            .Average(obs => obs.EstimatedValue));
 }