using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; namespace WebDoorCreator.Core { public class ExecStats { /// /// Numero chiamate registrate /// public int NumCall { get; set; } = 0; /// /// Durata totale chiamate /// public TimeSpan TotalTime { get; set; } = new TimeSpan(0, 0, 0); /// /// Tempo medio (calcolato) /// [NotMapped] public TimeSpan AvgTime { get { TimeSpan answ = TotalTime; if (NumCall > 1) { answ = TotalTime / NumCall; } return answ; } } /// /// Init classe /// /// /// public ExecStats(int numCall, TimeSpan duration) { this.NumCall = numCall; this.TotalTime = duration; } } }