public async Task <IActionResult> DeleteProduct(int id) { if (!await _catalogRepository.Exists(id)) { return(NotFound($"Product with id {id} is not found")); } await _catalogRepository.DeleteCatalogItem(id); return(NoContent()); }
public async Task <IActionResult> DeleteCatalogItem(int Id, int itemId) { var data = await _catalogDataRepository.GetCatalogItem(Id, itemId); if (data is null) { _logger.LogInformation($"With id {itemId} data wasn't found in Db"); return(NotFound()); } await _catalogDataRepository.DeleteCatalogItem(Id, itemId); if (!_catalogDataRepository.Save()) { return(StatusCode(500, "A problem happened while handeling your request")); } return(NoContent()); }
public ActionResult Delete(Guid id) { _repo.DeleteCatalogItem(id); return(new OkResult()); }
public ActionResult Delete(Guid id) { _catalogRepository.DeleteCatalogItem(id); return(new OkResult()); }
public async Task DeleteCatalogItem(int ctgTypeId, int ctgItemId) { await _catalogRepository.DeleteCatalogItem(ctgTypeId, ctgItemId); }