public IActionResult CreateProject([FromBody] ProjectDto projectD) { var project = converter.ToProject(projectD); pm.CreateProject(project); pm.CreateProjectSprintsForProject(project.Id, projectD.Sprints.Select(x => (int)x.Id).ToList()); pm.CreateProjectTagsForProject(project.Id, projectD.Tags.Select(x => (int)x.Id).ToList()); return(Ok(project.Id)); }
public ActionResult CreateOrUpdate(Project project) { if (ModelState.IsValid) { if (project.Id == 0) { project.CompletedPercentage = 0; project.CreatedBy = db.Users.Find(User.Identity.GetUserId()); projectManagement.CreateProject(project); } else { projectManagement.UpdateProject(project); } } else { return(RedirectToAction("List")); } return(RedirectToAction("List")); }