public async Task <IActionResult> DeleteItem(int id) { if (!await _catalogItemService.doExistsById(id)) { return(NotFound($"Catalog items with id: {id} does not exists")); } await _catalogItemService.Delete(id); return(Accepted()); }
public async Task <int> Handle(DeleteCatalogItemCommand request, CancellationToken cancellationToken) { return(await _catalogItemService.Delete(request.Id)); }