예제 #1
0
        public TheaterModelDTO GetTheater(Guid theaterId)
        {
            Theater spesificTheater = new Theater();

            using (var context = new CinemaEntities())
            {
                spesificTheater = (from theater in context.Theaters
                                                     where theater.TheaterID == theaterId
                                                     select theater).FirstOrDefault();
            }

            TheaterModelDTO theaterToReturn = new TheaterModelDTO();
            theaterToReturn.TheaterID = spesificTheater.TheaterID;
            theaterToReturn.Name = spesificTheater.Name;

            return theaterToReturn;
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the Theaters EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToTheaters(Theater theater)
 {
     base.AddObject("Theaters", theater);
 }
 /// <summary>
 /// Create a new Theater object.
 /// </summary>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="theaterID">Initial value of the TheaterID property.</param>
 public static Theater CreateTheater(global::System.String name, global::System.Guid theaterID)
 {
     Theater theater = new Theater();
     theater.Name = name;
     theater.TheaterID = theaterID;
     return theater;
 }