/// <summary> /// Create a new FilmShowing object. /// </summary> /// <param name="filmShowingID">Initial value of the FilmShowingID property.</param> public static FilmShowing CreateFilmShowing(global::System.Int32 filmShowingID) { FilmShowing filmShowing = new FilmShowing(); filmShowing.FilmShowingID = filmShowingID; return(filmShowing); }
private static void AddObject() { BookEntities ctx = new BookEntities(); Film NewFilm = new Film(); NewFilm.Title = "New film"; NewFilm.Description = "New film"; NewFilm.Length = 300; FilmShowing NewFilmShowing = new FilmShowing(); NewFilmShowing.Screen = 5; NewFilmShowing.ShowingDate = System.DateTime.Now; NewFilm.FilmShowings.Add(NewFilmShowing); ctx.AddObject("Films", NewFilm); ctx.SaveChanges(); //Another option //BookEntities ctx = new BookEntities(); //Film NewFilm = Film.CreateFilm(0); //NewFilm.Title = "New film2"; //NewFilm.Description = "New film"; //NewFilm.Length = 300; //ctx.AddToFilms(NewFilm); //ctx.SaveChanges(); }
/// <summary> /// Deprecated Method for adding a new object to the FilmShowings EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToFilmShowings(FilmShowing filmShowing) { base.AddObject("FilmShowings", filmShowing); }