public ActionResult <IReadOnlyList <RestaurantListGridVM> > GetFindAll([FromQuery] RestaurantAllParams restaurantAllParams) { var spec = new RestaurantAllSpecification(restaurantAllParams); var restaurantListVM = _mapper.Map <IReadOnlyList <RestaurantListGridVM> >(_restauranRepo.ListAsync(spec)); return(Ok(restaurantListVM)); }
public RestaurantAllSpecification(RestaurantAllParams restaurantAllParams) : base(x => restaurantAllParams.Name == null || x.Name.Equals(restaurantAllParams.Name) && x.IsCanceled.Equals(false)) { AddOrderBy(x => x.Name); }