コード例 #1
0
        public static ITrackTimeStatistic GetTrackTimeStatistic()
        {
            var tracks = Logic.Factory.GetALlTracks();

            var result = new Marketing.Models.TrackTimeStatistic {
                Longest  = tracks.Where(t1 => t1.Milliseconds == tracks.Max(t2 => t2.Milliseconds)).FirstOrDefault(),
                Shortest = tracks.Where(t1 => t1.Milliseconds == tracks.Min(t2 => t2.Milliseconds)).FirstOrDefault(),
                Avg      = (float)tracks.Average(t => t.Milliseconds)
            };

            return(result);
        }
コード例 #2
0
        public static Contracts.Report.Marketing.ITrackTimeStatistic GetTrackTimeStatistic()
        {
            var tracks = Logic.Factory.GetAllTracks();
            var result = new Marketing.Models.TrackTimeStatistic();

            result.maxName   = tracks.Max().Name;
            result.maxNumber = tracks.Max().Milliseconds.ToString();

            result.minName   = tracks.Min().Name;
            result.minNumber = tracks.Min().Milliseconds.ToString();

            result.avgNumber = tracks.Average(t => t.Milliseconds).ToString();

            return(result);
        }