public async Task <ActionResult <PublicApi.v1.DTO.ManuFacturerWithProductCount> > GetManuFacturer(int id) { var manuFacturer = await _bll.ManuFacturers.FindByIdAndShop(id, User.GetShopId()); if (manuFacturer == null) { return(NotFound()); } return(ManuFacturerMapper.MapFromBLL(manuFacturer)); }
public async Task <ActionResult <IEnumerable <PublicApi.v1.DTO.ManuFacturerWithProductCount> > > GetManuFacturers(string search, int?pageIndex, int?pageSize) { if ((pageIndex != null && pageIndex < 1) || (pageSize != null && pageSize < 1)) { return(BadRequest()); } var manuFacturer = (await _bll.ManuFacturers.GetAllWithProductCountAsync(User.GetShopId(), search, pageIndex, pageSize)).Select(e => ManuFacturerMapper.MapFromBLL(e)).ToList(); return(manuFacturer); }