Example #1
0
        public static IEnumerable <Car> GetTopAlbum(this carwebsite.Models.CarTypes cartypes, int count)
        {
            CarStoreEntities db = new CarStoreEntities();
            var Albums          = db.Cars.Where(a => a.CarTypesId == cartypes.CarTypesId).
                                  OrderByDescending(a => a.BookingDetails.Sum(o => o.Quantity))
                                  .Take(count)
                                  .ToList();

            return(Albums);
        }
Example #2
0
        public IEnumerable <Car> GetTopCar(int count)
        {
            CarStoreEntities db = new CarStoreEntities();
            var Albums          = db.Cars.Where(a => a.CarTypesId == CarTypesId).
                                  OrderByDescending(a => a.BookingDetails.Sum(o => o.Quantity))
                                  .Take(count)
                                  .ToList();

            return(Albums);
        }