コード例 #1
0
        private static void InitDB(BoardDb database)
        {
            /*
            foreach (MembershipUser user in Membership.GetAllUsers()) {
                Membership.DeleteUser(user.UserName,true);
            }*/

            const string u1 = "someuser";

            const string b1C1 = "this is a sample card 1";
            const string b1C2 = "this is a sample card 2";

            const string b1 = "boardName";
            const string b2 = "b2";

            const string b1L1 = "board 1 list 1";
            const string b1L2 = "board 1 list 2";
            const string b1L3 = "board 1 list 3";
            const string b2L1 = "board 2 list 1";

            database.AddBoard(u1,b1,"board 1",true);
            database.AddBoard(u1,b2,"board 2",false);

            int b1Id = database.GetBoardId(u1, b1);
            int b2Id = database.GetBoardId(u1, b2);

            int b1L1Id = database.AddListToBoard(b1Id, b1L1);
            database.AddListToBoard(b1Id, b1L2);
            database.AddListToBoard(b1Id, b1L3);

            database.AddListToBoard(b2Id, b2L1);

            database.AddCardToBoardList(b1L1Id, b1C1);
            database.AddCardToBoardList(b1L1Id, b1C2);
        }
コード例 #2
0
        protected void Application_Start()
        {
            Repo = new BoardDb();
            InitDB(Repo);

            AreaRegistration.RegisterAllAreas();

            // Use LocalDB for Entity Framework by default

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);
        }