Ejemplo n.º 1
0
 public static Videa.AvailMartNS.Data.DataServices.DetailedPeriod ToEntity(this DetailedPeriod source)
 {
     return(new Videa.AvailMartNS.Data.DataServices.DetailedPeriod
     {
         DetailedPeriodHashKey = source.DetailedPeriodHashKey.ToCharArray(),
         DetailedPeriodSqn = source.DetailedPeriodSqn,
         AvailLineWithDetailedPeriodsHashKey = source.AvailLineWithDetailedPeriodsHashKey.ToCharArray(),
         StartDate = source.StartDate.ToDateTime(),
         EndDate = source.EndDate.ToDateTime(),
         Rate = Decimal.Parse(source.Rate)
     });
 }
Ejemplo n.º 2
0
 private async Task <(Stream Chart, ResultMessage Message)> GetResult(StatisticsRequest request, DetailedPeriod period, DateTime startTimeRangeTimeOfDay)
 {
     var timeRange  = TimeRange.ToNow(startTimeRangeTimeOfDay.Add(-request.TimeBehind));
     var statistics = period switch
     {
        public async Task <IEnumerable <TimeStatisticItem> > GetStatisticsGroupedPerDetailedPeriod(StatisticsRequest statisticsRequest, TimeRange timeRange, DetailedPeriod period)
        {
            var messages = await this.GetMessages(statisticsRequest, timeRange);

            return(period switch
            {
                DetailedPeriod.Minute => this._timeSplittingService.GetStatisticsPerMinute(messages, timeRange),
                DetailedPeriod.Hour => this._timeSplittingService.GetStatisticsPerHour(messages, timeRange),
                _ => throw new NotImplementedException()
            });