public IActionResult Delete(int id) { _officeRepository.Delete(id); _unitOfWork.Commit(); return(new NoContentResult()); }
public ModelResponse Delete(UserInfo user, long id, string reason) { try { //Authorization if (user == null) { return(new ModelResponse(101)); } if (!user.IsApproved || user.IsIndividual || user.OrgContactId == null) { return(new ModelResponse(101)); } var isAdmin = DalFactory.Singleton.DataService.IsAdmin(user.UserId); if (!isAdmin) { return(new ModelResponse(101)); } Repo.Delete(id, user.UserId, reason); } catch (Exception ex) { return(new ModelResponse(ex)); } return(new ModelResponse(0)); }
public Task DeleteAsync(ResourceOrIdentifier <Office, int> input, IRequestContext context, CancellationToken cancellation) { try { return(Task.FromResult(_repository.Delete(input.Id))); } catch (Exception) { throw; } }
public IActionResult Delete(int id) { var todelete = _repository.Get(id); if (todelete != null) { _repository.Delete(todelete); return(Helper.CheckResult(todelete, true)); } return(NotFound()); }
public IHttpActionResult DeleteOffice(int id) { var office = _officeRepository.GetById(id); if (office == null) { return(ApiNotFound()); } _officeRepository.Delete(office); return(ApiNoContent()); }
public async Task <IActionResult> DeleteOffice(int id) { try { var office = await _officeRepository.FindById(id); await _officeRepository.Delete(office); return(Ok()); } catch (ArgumentException e) { return(Conflict(e.Message)); } catch (InvalidOperationException) { return(NotFound()); } catch (DbUpdateException e) { return(Conflict(e.Message)); } }
public int Delete(Guid[] ids) { return(_officeRepository.Delete(ids)); }
public async Task Delete(Office office) { await officeRepository.Delete(office); }