Exemple #1
0
        /// <summary>
        /// Đếm số lượng Seat
        /// </summary>
        /// <param name="UserEntity"></param>
        /// <param name="SearchSeatEntity"></param>
        /// <returns></returns>
        public int Count(UserEntity UserEntity, SearchSeatEntity SearchSeatEntity)
        {
            if (SearchSeatEntity == null)
            {
                SearchSeatEntity = new SearchSeatEntity();
            }
            IQueryable <Seat> Seats = CinemasEntities.Seats;

            Seats = SearchSeatEntity.ApplyTo(Seats);
            return(Seats.Count());
        }
Exemple #2
0
        /// <summary>
        /// Lọc thông tin Seat dựa trên điều kiện search
        /// </summary>
        /// <param name="UserEntity"></param>
        /// <param name="SearchSeatEntity"></param>
        /// <returns></returns>
        public List <SeatEntity> Gets(UserEntity UserEntity, SearchSeatEntity SearchSeatEntity)
        {
            if (SearchSeatEntity == null)
            {
                SearchSeatEntity = new SearchSeatEntity();
            }
            IQueryable <Seat> Seats = CinemasEntities.Seats.Include(s => s.Room);

            Seats = SearchSeatEntity.ApplyTo(Seats);
            Seats = SearchSeatEntity.SkipAndTake(Seats);
            return(Seats.ToList().Select(c => new SeatEntity(c, c.Room)).ToList());
        }