public async Task <IActionResult> Delete(Guid id) { var result = await _contactManager.DeleteAsync(id); if (result.IsSuccess) { return(Ok(new { Message = result.Message })); } return(BadRequest(new { Message = result.Message })); }
public async Task <ActionResult <ResponseModel <string> > > DeleteAsync(int id) { var result = await _contactManager.DeleteAsync(id, CurrentUser.Id); if (result) { return(Ok(new ResponseModel <string>("Contact deleted."))); } else { return(BadRequest(new ErrorModel("Unable to delete Contact."))); } }
public async Task <IActionResult> DeleteAsync(int id) { await _contactManager.DeleteAsync(id); return(NoContent()); }
public IActionResult Delete(Guid id) { return(new WebApiDelete(this, () => _manager.DeleteAsync(id), operationType: OperationType.Delete, statusCode: HttpStatusCode.NoContent)); }