Exemplo n.º 1
0
        public Athlete AddAthlete(string name, int bibNumber, int ageRankId, int teamId)
        {
            Athlete athlete = _context.Athletes.Add(new Athlete
            {
                Name      = name,
                Number    = bibNumber,
                AgeRankId = ageRankId,
                TeamId    = teamId
            });

            _context.SaveChanges();
            return(athlete);
        }
Exemplo n.º 2
0
        public AgeRank AddAgeRank(string name)
        {
            AgeRank ageRank = _context.AgeRanks.Add(new AgeRank
            {
                Name = name
            });

            _context.SaveChanges();
            return(ageRank);
        }
Exemplo n.º 3
0
        public Team AddTeam(string name)
        {
            Team team = _context.Teams.Add(new Team
            {
                Name = name
            });

            _context.SaveChanges();
            return(team);
        }
Exemplo n.º 4
0
        public Race AddRace(string name, DateTime?raceDate)
        {
            Race race = _context.Races.Add(new Race
            {
                Name     = name,
                RaceDate = raceDate
            });

            _context.SaveChanges();
            return(race);
        }
        public RaceResult AddRaceResult(int position, int points, int athleteId, int ageRankId, int raceId)
        {
            RaceResult result = _context.RaceResults.Add(new RaceResult
            {
                Position  = position,
                Points    = points,
                AthleteId = athleteId,
                AgeRankId = ageRankId,
                RaceId    = raceId
            });

            _context.SaveChanges();
            return(result);
        }