public async Task <List <ShopViewModel> > GetAllShopAsync(ShopRequestGetAllModel shopRequestGetAllModel) { var list = await GetAll() .Where(x => (!shopRequestGetAllModel.IsActive.HasValue || x.RecordActive == shopRequestGetAllModel.IsActive) && (string.IsNullOrEmpty(shopRequestGetAllModel.Query) || (x.Name.Contains(shopRequestGetAllModel.Query) ))) .Select(x => new ShopViewModel(x)).ToListAsync(); return(list); }
public async Task <IActionResult> GetAllShops(ShopRequestGetAllModel shopRequestGetAllModel) { var shop = await _shopService.GetAllShopAsync(shopRequestGetAllModel); return(Ok(shop)); }