public async Task <IEnumerable <EnergyObservationModel> > GetAllObservationsAsync() { var enumerator = await Task.Run(() => _storage.GetEnumerator()); var observations = new List <EnergyObservationModel>(); while (enumerator.MoveNext()) { observations.Add(_mapper.Map <EnergyObservationModel>(enumerator.Current)); } return(observations); }
public IEnumerator <T> GetEnumerator() => LoggerHelper.RunWithLogging(_logger, () => _innerStorage.GetEnumerator(), nameof(GetEnumerator));