예제 #1
0
        public async Task <IEnumerable <TheaterDTO> > SearchTheaters(SearchTheraterDTO parameters)
        {
            List <Theater> theaters = _query.SetBaseTheatersInfo()
                                      .SetTheaterName(parameters.Name)
                                      .SetTheaterType(parameters.Type)
                                      .Sort(parameters.FieldToSort, parameters.Descending)
                                      .Build()
                                      .ToList();

            return(_mapper.Map <IEnumerable <TheaterDTO> >(theaters));
        }
예제 #2
0
        public async Task <IActionResult> GetTheaters([FromQuery] SearchTheraterDTO parameters)
        {
            IEnumerable <TheaterDTO> theaters = await _theaterService.SearchTheaters(parameters);

            return(Ok(theaters));
        }