public FoxEbookDbService(bool LazyLoading = true) { Database.SetInitializer <FoxEbookDbContext>(new FoxEbookDbSeeder()); dbcontext = new FoxEbookDbContext(); if (!LazyLoading) { dbcontext.CategoryItems.Include(cat => cat.Products).ToList(); } }
private void InitApplication() { LogManager.Init(); // Program.DatabaseSetup(); foxeContext = new FoxEbookDbContext(); foxeContext.Database.Log = Console.Write; foxeTreeViewNotifications = Global.FoxeTreeViewNotifications; jobNotifications = Global.JobNotifications; jobNotifications.JobCompleted += new EventHandler <JobCompletedEventArgs>(jobNotifications_JobCompleted); //foxeTreeViewNotifications.DownloadFoxeProducts+=new EventHandler<FoxeDownloadProductsEventArgs>(foxeTreeViewNotifications_DownloadFoxeProducts); foxeTreeViewNotifications.GotoParent += new EventHandler <FoxeGotoParentEventArgs>(foxeTreeViewNotifications_GotoParent); foxeRootTreeViewNode = CreateRootFoxeTreeViewNode(); gvJobsSummary.ItemsSource = JobQueue.JobsSummary; gvLog.ItemsSource = LogManager.LogsList; Global.StartScheduler(); }