Exemplo n.º 1
0
        public int Count(UserEntity UserEntity, SearchOrderEntity SearchOrderEntity)
        {
            if (SearchOrderEntity == null)
            {
                SearchOrderEntity = new SearchOrderEntity();
            }
            IQueryable <Order> Orders = CinemasEntities.Orders;

            Orders = SearchOrderEntity.ApplyTo(Orders);
            return(Orders.Count());
        }
Exemplo n.º 2
0
        public List <OrderEntity> Gets(UserEntity UserEntity, SearchOrderEntity SearchOrderEntity)
        {
            if (SearchOrderEntity == null)
            {
                SearchOrderEntity = new SearchOrderEntity();
            }
            IQueryable <Order> Orders = CinemasEntities.Orders
                                        .Include(o => o.Seats.Select(s => s.Room))
                                        .Include(o => o.Showtime.Film)
                                        .Include(o => o.Showtime.Room);

            Orders = SearchOrderEntity.ApplyTo(Orders);
            Orders = SearchOrderEntity.SkipAndTake(Orders);
            return(Orders.ToList().Select(c => new OrderEntity(c, c.Showtime, c.Seats)).ToList());
        }
Exemplo n.º 3
0
 public List <OrderEntity> Gets([FromUri] SearchOrderEntity SearchOrderEntity)
 {
     return(OrderService.Gets(UserEntity, SearchOrderEntity));
 }
Exemplo n.º 4
0
 public int Count([FromUri] SearchOrderEntity SearchOrderEntity)
 {
     return(OrderService.Count(UserEntity, SearchOrderEntity));
 }