// DELETE: api/WebApiProject/5 public IHttpActionResult Delete(int id) { Project P = PS.GetById(id); PS.Delete(P); PS.Commit(); return(Ok()); }
public IActionResult Delete(int id) { var projectsFromRepo = _services.GetByID(id); if (projectsFromRepo == null) { return(BadRequest("Not a value project id")); } _services.Delete(projectsFromRepo); _services.SaveChange(); return(Ok()); }
public ActionResult Delete(int id, ProjectViewModel PVM) { Project p = ps.GetById(id); PVM.ProjectId = p.ProjectId; PVM.ProjectName = p.ProjectName; PVM.Start_Date = p.Start_Date; PVM.End_Date = p.End_Date; PVM.Duration = p.Duration; PVM.Description = p.Description; ps.Delete(p); ps.Commit(); return(RedirectToAction("Index")); }
public IHttpActionResult DeleteProject(long projectId) { Project project = _services.Delete(projectId); return(Ok(project)); }