/// <summary>
 /// Deprecated Method for adding a new object to the TimeSlots EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToTimeSlots(TimeSlot timeSlot)
 {
     base.AddObject("TimeSlots", timeSlot);
 }
Exemple #2
0
        static void CreateSampleTimeSlots(ThripEntities dataContext)
        {
            var _timeSlot = new TimeSlot();

            _timeSlot.Id = Guid.NewGuid();
            _timeSlot.Name = "Welcome Session";
            _timeSlot.StartDate = DateTime.Now; // DateTime.Parse("9/3/2010 08:00");
            _timeSlot.EndDate = DateTime.Now.AddHours(1); // DateTime.Parse("9/3/2010 09:00");
            dataContext.TimeSlots.AddObject(_timeSlot);

            dataContext.SaveChanges();

            _timeSlot = new TimeSlot();

            _timeSlot.Id = Guid.NewGuid();
            _timeSlot.Name = "Friday Morning";
            _timeSlot.StartDate = DateTime.Parse("9/3/2010 09:15");
            _timeSlot.EndDate = DateTime.Parse("9/3/2010 11:00");
            dataContext.TimeSlots.AddObject(_timeSlot);

            dataContext.SaveChanges();

            _timeSlot = new TimeSlot();

            _timeSlot.Id = Guid.NewGuid();
            _timeSlot.Name = "Friday Midday";
            _timeSlot.StartDate = DateTime.Parse("9/3/2010 11:15");
            _timeSlot.EndDate = DateTime.Parse("9/3/2010 12:45");
            dataContext.TimeSlots.AddObject(_timeSlot);

            dataContext.SaveChanges();

            _timeSlot = new TimeSlot();

            _timeSlot.Id = Guid.NewGuid();
            _timeSlot.Name = "Friday Afternoon";
            _timeSlot.StartDate = DateTime.Parse("9/3/2010 13:00");
            _timeSlot.EndDate = DateTime.Parse("9/3/2010 16:00");
            dataContext.TimeSlots.AddObject(_timeSlot);

            dataContext.SaveChanges();

            _timeSlot = new TimeSlot();

            _timeSlot.Id = Guid.NewGuid();
            _timeSlot.Name = "Satuday Wake-up";
            _timeSlot.StartDate = DateTime.Parse("9/4/2010 08:00");
            _timeSlot.EndDate = DateTime.Parse("9/4/2010 09:00");
            dataContext.TimeSlots.AddObject(_timeSlot);

            dataContext.SaveChanges();
        }
 /// <summary>
 /// Create a new TimeSlot object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 public static TimeSlot CreateTimeSlot(global::System.Guid id, global::System.String name)
 {
     TimeSlot timeSlot = new TimeSlot();
     timeSlot.Id = id;
     timeSlot.Name = name;
     return timeSlot;
 }