Пример #1
0
        protected override void OnUserSignedIn(GraywulfIdentity identity)
        {
            // Check if user's myDB exists, if not, create
            using (var context = CreateRegistryContext())
            {
                var mydb = context.Federation.MyDBDatabaseVersion.GetUserDatabaseInstance(identity.User);

                if (mydb == null)
                {
                    var udii = new UserDatabaseInstanceInstaller(identity.User);
                    var udi = udii.GenerateUserDatabaseInstance(context.Federation.MyDBDatabaseVersion);

                    mydb = udi.DatabaseInstance;
                    mydb.Deploy();
                }
            }
        }
Пример #2
0
        // ---
        protected override void OnUserLoggedIn()
        {
            base.OnUserLoggedIn();

            if (MyDBDatabaseInstance == null)
            {
                var udii = new UserDatabaseInstanceInstaller(RegistryUser);
                var udi = udii.GenerateUserDatabaseInstance(MyDBDatabaseVersion);

                var mydb = udi.DatabaseInstance;
                mydb.Deploy();
            }
        }