public async Task <ActionResult> Delete([Required] List <Guid> ids, CancellationToken ct = default) { var suppliers = await _suppliersService.GetListAsync(ids, ct); return(await ActionIfAllowed( () => _suppliersService.DeleteAsync(_userContext.UserId, suppliers.Select(x => x.Id), ct), Roles.Suppliers, suppliers.Select(x => x.AccountId))); }
public HttpResponseMessage Delete(int id) { HttpResponseMessage responseMessage; try { service.DeleteAsync(id); responseMessage = new HttpResponseMessage(HttpStatusCode.OK); } catch { responseMessage = new HttpResponseMessage(HttpStatusCode.NotFound); } return(responseMessage); }