public IQueryable <Car> GetCars()
        {
            var _db = new CarsAndTheirUsers.Models.MyDbContext();
            IQueryable <Car> query = _db.Cars;

            return(query);
        }
Example #2
0
        public IQueryable <Accessibility> GetCars([QueryString("id")] int?userId)
        {
            var _db = new CarsAndTheirUsers.Models.MyDbContext();
            IQueryable <Accessibility> query = _db.Accessibilities;

            if (userId.HasValue && userId > 0)
            {
                query = query.Where(p => p.UserID == userId);
            }
            return(query);
        }