public bool AddTeamToRace(int raceEventId, int teamId, string updateById) { var team = GetById(teamId); team.RaceEventId = raceEventId; team.UpdatedOn = DateTime.Now; team.UpdatedById = updateById; repo.Update(team); return(repo.SaveChanges()); }
public bool Delete(int teamId) { var team = repo.GetById(teamId); var users = userRepo.GetAllByTeamId(teamId); foreach (var user in users) { user.TeamId = null; } repo.Delete(team); return(repo.SaveChanges()); }