public async Task <ActionResult <IEnumerable <PublicApi.v1.DTO.ProductWithDefect> > > GetInfoByDefectId(int id) { var productsWithDefect = (await _bll.ProductsWithDefect.AllAsyncByShopAndDefectIdDTO(id, User.GetShopId())) .Select(e => ProductWithDefectMapper.MapFromBLL(e)).ToList(); return(productsWithDefect); }
public async Task <ActionResult <PublicApi.v1.DTO.ProductWithDefect> > GetProductWithDefect(int id) { var productWithDefect = await _bll.ProductsWithDefect.GetAsyncByShopAndIdDTO(id, User.GetShopId()); if (productWithDefect == null) { return(NotFound()); } return(ProductWithDefectMapper.MapFromBLL(productWithDefect)); }