示例#1
0
        public ActionResult AddTeam(AddTeamViewModel model)
        {
            var team = new Team()
            {
                Name = model.Name
            };
            var temp = model.SelectedWorkers.Select(p => _db.GetUserById(int.Parse(p)).UserDetails).ToList();

            team.Members = temp;
            team.Members.Add(_db.GetUserByEmail(User.Identity.Name).UserDetails);
            _db.AddTeam(team);


            return(RedirectToAction("Index"));
        }