public override IEnumerable <Restaurant> All()
 {
     return(RepositoryDbSet.AsQueryable()
            .Include(a => a.Address)
            .Include(a => a.RatingLogs)
            .ToList());
 }
示例#2
0
        public async Task <int> CountDataAmount(string search)
        {
            var query = RepositoryDbSet.AsQueryable();

            query = Search(query, search);

            return(await query.CountAsync());
        }
示例#3
0
        public List <User> GetOrderedRecords(int recordLimit, bool orderByFirstName = true)
        {
            var query = RepositoryDbSet.AsQueryable();

            query = orderByFirstName ? query.OrderBy(a => a.FirstName) : query.OrderBy(a => a.LastName);
            switch (recordLimit)
            {
            case 0:
                break;

            default:
                query = query.Take(count: recordLimit);
                break;
            }
            return(query.ToList());
        }
示例#4
0
        public List <Ticket> GetOrderedRecords(int recordLimit, bool orderByDescription = true)
        {
            var query = RepositoryDbSet.AsQueryable();

            query = orderByDescription ? query.OrderBy(a => a.Description) : query.OrderBy(a => a.TicketId);
            switch (recordLimit)
            {
            case 0:
                break;

            default:
                query = query.Take(count: recordLimit);
                break;
            }
            return(query.ToList());
        }
        public List <RolePermission> GetOrderedRecords(int recordLimit, bool orderByRolePermission = true)
        {
            var query = RepositoryDbSet.AsQueryable();

            query = orderByRolePermission ? query.OrderBy(a => a.RolePermissionId) : query.OrderBy(a => a.UserRole);
            switch (recordLimit)
            {
            case 0:
                break;

            default:
                query = query.Take(count: recordLimit);
                break;
            }
            return(query.ToList());
        }
示例#6
0
        public List <Reply> GetOrderedRecords(int recordLimit, bool orderByReplyDtime = true)
        {
            var query = RepositoryDbSet.AsQueryable();

            query = orderByReplyDtime ? query.OrderBy(a => a.ReplyDtime) : query.OrderBy(a => a.ReplyIdentifier);
            switch (recordLimit)
            {
            case 0:
                break;

            default:
                query = query.Take(count: recordLimit);
                break;
            }
            return(query.ToList());
        }
        public List <TicketHistory> GetOrderedRecords(int recordLimit, bool orderByTicketStatusCode = true)
        {
            var query = RepositoryDbSet.AsQueryable();

            query = orderByTicketStatusCode ? query.OrderBy(a => a.TicketStatusCode) : query.OrderBy(a => a.TicketHisDtime);
            switch (recordLimit)
            {
            case 0:
                break;

            default:
                query = query.Take(count: recordLimit);
                break;
            }
            return(query.ToList());
        }
示例#8
0
 public override IEnumerable <Promotion> All()
 {
     return(RepositoryDbSet.AsQueryable()
            .ToList());
 }
 public int GetUserRestaurantCount(string userId)
 {
     return(RepositoryDbSet.AsQueryable().Count(r => r.UserId == userId));
 }
 public IEnumerable <RestaurantUser> FindAllByUserId(string userId)
 {
     return(RepositoryDbSet.AsQueryable().ToList().Where(r => r.UserId == userId));
 }
 public IEnumerable <RestaurantUser> FindAllByRestaurantId(int restaurantId)
 {
     return(RepositoryDbSet.AsQueryable().ToList().Where(r => r.RestaurantId == restaurantId));
 }
 public IEnumerable <RestaurantUser> FindAll(params object[] restaurantId)
 {
     return(RepositoryDbSet.AsQueryable().ToList().Where(r => r.RestaurantId == (int)restaurantId[0]));
 }
 public IEnumerable <IdentityUserRole <string> > getUserRolesForUser(User user)
 {
     return(RepositoryDbSet.AsQueryable().ToList().Where(ur => ur.UserId == user.Id));
 }
示例#14
0
 public override IEnumerable <RatingLog> All()
 {
     return(RepositoryDbSet.AsQueryable()
            .ToList());
 }
示例#15
0
 public int GetUserMenuCount(string userId)
 {
     return(RepositoryDbSet.AsQueryable().Count(m => m.UserId == userId));
 }
 public override IEnumerable <Ingredient> All()
 {
     return(RepositoryDbSet.AsQueryable()
            .ToList());
 }
示例#17
0
 public override IEnumerable <Person> All()
 {
     return(RepositoryDbSet.AsQueryable()
            .Include(x => x.Cars).ToList());
 }