public IActionResult Add(string title, string username, string assigneename) { //string name = Request.Form["username"]; var currentAssignee = todoRepository.toDoContext.Users.FirstOrDefault(x => x.Name == assigneename); var currentCreator = todoRepository.toDoContext.Users.FirstOrDefault(x => x.Name == username); ToDo newToDo = new ToDo() { Title = title, Creator = currentCreator, Assignee = currentAssignee }; todoRepository.AddNewTodo(newToDo); return(RedirectToAction("list")); }