示例#1
0
        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 }));
        }
示例#2
0
        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));
        }