public async Task <ResultDto> RemoveEmailHistoryInfo(int ehID) { return(new ResultDto() { Success = await _context.Delete(ehID) }); }
public ActionResult DeleteConfirmed(int ownerId) { Owner owner = _ownerRepository.GetOwner(ownerId); _ownerRepository.Delete(ownerId); _ownerRepository.Save(); return(RedirectToAction("Index")); }
public Owner DeleteOwner(int id) { if (id < 1) { throw new InvalidOperationException("Id must be bigger than 0"); } return(_ownerRepo.Delete(id)); }
public Owner Delete(int Id) { if (Id <= 0) { throw new NullReferenceException("Id cannot be in negative"); } return(_ownerRepository.Delete(Id)); }
public Owner Delete(int id) { Owner owner = _ownerRepository.ReadById(id); if (owner == null) { throw new NullReferenceException($"The owner with Id: {id} does not exist"); } return(_ownerRepository.Delete(id)); }
public async Task <ActionResult> DeleteOwner(int?id) { if (id is null) { throw new NullReferenceException(nameof(id)); } await ownerRepository.Delete((int)id); return(RedirectToAction("Index", "Owner")); }
public AppMutation(IOwnerRepository repository) { Field <OwnerType>("createOwner", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <OwnerInputType> > { Name = "owner" }), resolve: context => { var owner = context.GetArgument <Owner>("owner"); return(repository.Create(owner)); }); //update Field <OwnerType>( "updateOwner", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <OwnerInputType> > { Name = "owner" }, new QueryArgument <NonNullGraphType <IdGraphType> > { Name = "Id" }), resolve: context => { var owner = context.GetArgument <Owner>("owner"); var ownerId = context.GetArgument <Guid>("Id"); owner.Id = ownerId; return(repository.Update(owner)); } ); Field <StringGraphType>( "deleteOwner", arguments: new QueryArguments(new QueryArgument <NonNullGraphType <IdGraphType> > { Name = "ownerId" }), resolve: context => { var ownerId = context.GetArgument <Guid>("ownerId"); // if (ownerId == null) //{ // context.Errors.Add(new ExecutionError("Owner nao encontrado.")); // return null; // } repository.Delete(ownerId); return($"Owner id: {ownerId} deletado com sucesso."); } ); }
public async Task <IActionResult> DeleteOwner(int id) { Owner owner = await _ownerRepository.FindAsync(id); if (owner == null) { return(NotFound()); } _ownerRepository.Delete(owner); return(NoContent()); }
public async Task <string> Delete(string id) { try { await productRepository.Delete(id); return("OK"); } catch (Exception ex) { throw new RestException(System.Net.HttpStatusCode.NotFound, ex.Message); } }
public Owner Delete(int id) { if (id < 1) { throw new ArgumentException($"Id must be a positive integer."); } Owner owner = _ownerRepository.Delete(id); if (owner is null) { throw new KeyNotFoundException($"No record with id {id} was found."); } return(owner); }
public Owner Delete(int id) { var ownerToDelete = ReadOwnerById(id); if (ownerToDelete == null) { throw new InvalidDataException("The id is not right"); } else { _ownerRepo.Delete(ownerToDelete.Id); return(ownerToDelete); } }
public async Task <Response> Delete(int id) { try { Response response = await _OwnerRepo.Delete(id); return(response); } catch (Exception e) { StringBuilder sb = new StringBuilder(); log.Error(sb.AppendLine(e.Message).AppendLine(e.StackTrace).ToString()); Response r = new Response() { Success = false }; r.ErrorList.Add("Error on delete Owner"); return(r); } }
public Owner DeleteOwner(int id) { return(_ownerRepo.Delete(id)); }
public void Delete(Owner owner) { _ownerRepo.Delete(owner); }
public void DeleteOwner(int id) { _ownerRepo.Delete(id); }
public bool Delete(int Id) { return(_ownerRepository.Delete(Id)); }
public void Delete(int Id) { ownerRepository.Delete(Id); }
public Owner Delete(int id) { return(_ownerRepository.Delete(id)); }
public Owner Delete(int id) { return(findOwnerById(id) == null ? throw new InvalidDataException("Owner not found or already deleted") : _ownerRepository.Delete(id)); }
public Owner Delete(Owner owner) { return(_ownerRepo.Delete(Owner.Id)); }
public void Delete(int id) { _ownerRepository.Delete(id); }
public IActionResult Delete(int id) { repository.Delete(id); return(RedirectToAction("List")); }
public async Task <bool> DeleteOwnerAsync(long ownerId) { return(await _ownerRepository.Delete(ownerId)); }