public async Task <IActionResult> Delete(int id) { Call _call = _callRepository.GetSingle(id); if (_call == null) { return(NotFound()); } _callRepository.Delete(_call); if (await _callRepository.Commit()) { return(new NoContentResult()); } return(BadRequest()); }
public async Task <ICommandResult> Handle(DeleteCallCommand command) { Call Call = await _CallRepository.GetById(command.Id); if (Call == null) { return(new CommandResult(false, Messages.Account_NOT_FOUND, null)); } await _CallRepository.Delete(Call); return(new CommandResult( true, Messages.DELETED_WITH_SUCCESS, null)); }