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); }
public AgeRank AddAgeRank(string name) { AgeRank ageRank = _context.AgeRanks.Add(new AgeRank { Name = name }); _context.SaveChanges(); return(ageRank); }
public Team AddTeam(string name) { Team team = _context.Teams.Add(new Team { Name = name }); _context.SaveChanges(); return(team); }
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); }