public IActionResult AddProject(ProjectViewModel model) { var project = new Project(); project.Name = model.Name; project.Description = model.Description; var userId = _userManager.GetLoggedUserId(); project.OwnerId = userId; _projectManager.Add(project); _projectManager.Commit(); return(RedirectToAction("Project", new { id = project.Id })); }
public IActionResult AddProject(ProjectViewModel model) { var project = new Project(); project.Name = model.Name; project.Description = model.Description; var userId = _userManager.GetLoggedUserId(); project.OwnerId = userId; _projectManager.Add(project); _projectManager.Commit(); var results = project; return(Ok(results)); }