public HttpResponseMessage Delete(int id) { _projectService.Delete(id); SuccessResponse response = new SuccessResponse(); return(Request.CreateResponse(HttpStatusCode.OK, response)); }
public async Task <Response> Delete(Guid projectId, ClaimsPrincipal claims) { var result = await _service.Delete(projectId, claims.GetUserId()); // await BroadcastChanges(result, ChangesType.Deleted); return(result); }
public IActionResult Delete(int id) { if (_projectsService.GetById(id) == null) { return(NotFound()); } _projectsService.Delete(id); return(Ok()); }
public async Task <IActionResult> Delete(Guid projectId) { var id = User.Claims.Where(c => c.Type == "Id").Select(c => c.Value).SingleOrDefault(); if (String.IsNullOrEmpty(id)) { return(Unauthorized()); } Guid actorId = new Guid(id); try { await _projectsService.Delete(projectId, actorId); return(Ok()); } catch (Exception e) { return(BadRequest(e.Message)); } }
public async Task <IHttpActionResult> Delete(int id) { if (id < 1) { return(BadRequest()); } try { await _projectsService.Delete(id, GetUserAndOrganization()); return(Ok()); } catch (ValidationException e) { return(BadRequestWithError(e)); } catch (UnauthorizedException) { return(Forbidden()); } }
public async Task <IActionResult> Delete(Project model) { await _projectService.Delete(model); return(RedirectToAction("Get")); }
public async Task <IActionResult> Delete(Project model) { await _projectService.Delete(model); return(Ok(model)); }
public IActionResult Delete(int id) { _projectsService.Delete(id); return(RedirectToAction(nameof(ProjectsController.Index), "Projects")); }
public ActionResult Delete(int projectId) { _projectsService.Delete(projectId); return(RedirectToAction("Index")); }