コード例 #1
0
ファイル: SetupController.cs プロジェクト: vtalas/cms
 public ActionResult DropAndCreateTables()
 {
     Database.SetInitializer(new DropAndCreateTables());
     using (var a = new EfContext())
     {
         Response.Write(a.ApplicationSettings.ToList()[0].Id);
         Response.Write(" \n");
         Response.Write(WebSecurity.Initialized);
     }
     return View();
 }
コード例 #2
0
        public void Get_ByLink_test_SESSIONMANAGER()
        {
            using (var db = new EfContext())
            {
                var useriId = CreateUser("admin");
                AApplication("prd", SessionProviderFactoryTest.DefaultAppId)
                    .WithUser(db.UserProfile.Single(x => x.Id == useriId))
                    .WithGrid(AGrid()
                     .WithResource(SpecialResourceEnum.Link, "xxx"))
                     .AddTo(new EfRepository(db));
            }

            using (var db = SessionProvider.CreateSession())
            {
                var a = db.Session.Page.Get("xxx");
            }
        }
コード例 #3
0
ファイル: SetupController.cs プロジェクト: vtalas/cms
        public ActionResult DropAndCreateAlwaysForce()
        {
            Database.SetInitializer(new DropAndCreateAlwaysForce());
            //			Database.Delete("")

            using (var a = new EfContext())
            {
                Xxx.DeleteDatabaseData();
                new DropAndCreateAlwaysForce().InitializeDatabase(a);
                SecurityProvider.EnsureInitialized(true);
                new SampleData(a).Generate();

                Response.Write(a.ApplicationSettings.ToList()[0].Id);
                Response.Write(" \n");
                Response.Write(WebSecurity.Initialized);
            }
            return RedirectToAction("Index");
        }