/// <summary> /// Deprecated Method for adding a new object to the RaceAthletes EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToRaceAthletes(RaceAthlete raceAthlete) { base.AddObject("RaceAthletes", raceAthlete); }
public void ConnectToRace(int raceId) { Entities context = new Entities(); RaceAthlete raceAthlete = new RaceAthlete(); raceAthlete.AthleteId = Id; raceAthlete.RaceId = raceId; if (StartNumber.HasValue) raceAthlete.Startnumber = StartNumber.Value; context.RaceAthletes.AddObject(raceAthlete); context.SaveChanges(); }
/// <summary> /// Create a new RaceAthlete object. /// </summary> /// <param name="raceId">Initial value of the RaceId property.</param> /// <param name="athleteId">Initial value of the AthleteId property.</param> public static RaceAthlete CreateRaceAthlete(global::System.Int32 raceId, global::System.Int32 athleteId) { RaceAthlete raceAthlete = new RaceAthlete(); raceAthlete.RaceId = raceId; raceAthlete.AthleteId = athleteId; return raceAthlete; }