public IActionResult Create(ProjectsCreateVM createProject) { if (!ModelState.IsValid) { return(View(createProject)); } repository.AddNewProjectVM(createProject); return(RedirectToAction(nameof(Index))); }
//public static ProjectsIndexVM temp = new ProjectsIndexVM(); public void AddNewProjectVM(ProjectsCreateVM create) { context.Add(new Projects { Name = create.Name, Hours = 0, Minutes = 0, Seconds = 0, Milliseconds = 0, Category = create.Category }); context.SaveChanges(); }