Пример #1
0
        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());
        }
Пример #2
0
        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());
        }