public void AddUserToTeam(int id, TeamMember member)
        {
            Data.TeamMember teamMember = null;

            var team = _teamRepo.FindById(id);
            if (team.TeamMembers.Any(i => i.UserId == member.EmailAddress))
            {
                teamMember = team.TeamMembers.Where(i => i.UserId == member.EmailAddress).First();
            }
            else
            {
                teamMember = new Data.TeamMember() { UserId = member.EmailAddress };
                team.TeamMembers.Add(teamMember);
            }

            teamMember.IsAdmin = member.IsAdmin;

            _teamRepo.SaveChanges();
        }
 public IHttpActionResult UpdateTeamMembers(int id, TeamMember teamMember)
 {
     if (ModelState.IsValid)
     {
         if (TeamLogic.TeamExists(id))
         {
             TeamLogic.AddUserToTeam(id, teamMember);
             return Ok();
         }
         else
         {
             return NotFound();
         }
     }
     else
     {
         return BadRequest(ModelState);
     }
 }