public ActionResult NewGoal(GoalViewModel goalModel) { string goalName = goalModel.Name; // Check if goal is empty if ((goalName != null) && (goalName.Length > 0)) { GoalViewModel newGoalModel = new GoalViewModel() { AspNetUserID = User.Identity.GetUserId(), Name = goalModel.Name, Description = goalModel.Description, ProjectID = goalModel.ProjectID, Finished = false }; projectService.AddGoal(newGoalModel); } return(RedirectToAction("Index", "Project", new { projectID = goalModel.ProjectID, tabMake = "project-goals" })); }