/// <summary> /// Create a new CalendarDay object. /// </summary> /// <param name="calDay">Initial value of the CalDay property.</param> public static CalendarDay CreateCalendarDay(global::System.DateTime calDay) { CalendarDay calendarDay = new CalendarDay(); calendarDay.CalDay = calDay; return calendarDay; }
/// <summary> /// Deprecated Method for adding a new object to the CalendarDays EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToCalendarDays(CalendarDay calendarDay) { base.AddObject("CalendarDays", calendarDay); }
static void daty() { using (PrdnEntities ctx = new PrdnEntities()) { var q = from p in ctx.CalendarDays orderby p.CalDay select p; ObjectQuery oq = (ObjectQuery)q; string s = oq.ToTraceString(); Console.WriteLine(s); Console.ReadLine(); CalendarDay c = new CalendarDay(); c.CalDay = DateTime.Today; ctx.CalendarDays.AddObject(c); ctx.SaveChanges(); } }