/// <summary> /// Đếm số lượng Showtime /// </summary> /// <param name="UserEntity"></param> /// <param name="SearchShowtimeEntity"></param> /// <returns></returns> public int Count(UserEntity UserEntity, SearchShowtimeEntity SearchShowtimeEntity) { if (SearchShowtimeEntity == null) { SearchShowtimeEntity = new SearchShowtimeEntity(); } IQueryable <Showtime> Showtimes = CinemasEntities.Showtimes; Showtimes = SearchShowtimeEntity.ApplyTo(Showtimes); return(Showtimes.Count()); }
/// <summary> /// Lọc thông tin Showtime theo điều kiện search /// </summary> /// <param name="UserEntity"></param> /// <param name="SearchShowtimeEntity"></param> /// <returns></returns> public List <ShowtimeEntity> Gets(UserEntity UserEntity, SearchShowtimeEntity SearchShowtimeEntity) { if (SearchShowtimeEntity == null) { SearchShowtimeEntity = new SearchShowtimeEntity(); } IQueryable <Showtime> Showtimes = CinemasEntities.Showtimes.Include(st => st.Room).Include(st => st.Film); Showtimes = SearchShowtimeEntity.ApplyTo(Showtimes); Showtimes = SearchShowtimeEntity.SkipAndTake(Showtimes); return(Showtimes.ToList().Select(st => new ShowtimeEntity(st, st.Film, st.Room)).ToList()); }