示例#1
0
        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);
        }
示例#2
0
        public async Task <IActionResult> GetAllShops(ShopRequestGetAllModel shopRequestGetAllModel)
        {
            var shop = await _shopService.GetAllShopAsync(shopRequestGetAllModel);

            return(Ok(shop));
        }