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)); }
public async Task <IActionResult> GetTheaters([FromQuery] SearchTheraterDTO parameters) { IEnumerable <TheaterDTO> theaters = await _theaterService.SearchTheaters(parameters); return(Ok(theaters)); }