Example #1
0
        //TODO: Add new fetures: 1. Year of Trip (start) 2. TripStart and End Date 3. Number of days
        public IDictionary <string, int> Statistics()
        {
            var statistics = new Dictionary <string, int>
            {
                { "countriesCount", Countries().Count() },
                { "stopsCount", Stops.Count() },
                { "userCount", Users().Count() },
                { "worldHeritages", WorldHeritages().Count() },
                { "yearOfTrip", Stops.Select(s => s.Arrival.Year).Max() },
                { "numberOfDays", System.Convert.ToInt32(System.Math.Floor((Stops.Select(s => s.Departure).Max() - Stops.Select(s => s.Arrival).Min()).TotalDays)) }
            };

            return(statistics);
        }