public async Task <IActionResult> Delete(string id) { if (string.IsNullOrWhiteSpace(id)) { throw new ArgumentNullException(nameof(id)); } if (!await _endpointRepository.Remove(id)) { return(this.GetError(Constants.Errors.ErrRemoveEndpoint, HttpStatusCode.InternalServerError)); } return(new OkResult()); }
public RedirectResult Remove(int id) { _repository.Remove(id); return(Redirect("/Home/Index")); }