Ejemplo n.º 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());
        }
Ejemplo n.º 2
0
 public double GetAverageEnergy(DateTime startFrom, DateTime endBy)
 {
     return(_energyObservationStorage.Where(e => e.ObservationTime >= startFrom && e.ObservationTime <= endBy)
            .Average(e => e.EstimatedValue));
 }
Ejemplo n.º 3
0
 public double GetAverageEnergy(DateTime startFrom, DateTime endBy)
 {
     return(_observationStorage.Where(obs => obs.ObservationTime >= startFrom && endBy >= obs.ObservationTime)
            .Average(obs => obs.EstimatedValue));
 }