Exemple #1
0
 public UserStore(String connectionNameOrUrl)
 {
     this.database       = MongoDBUtilities.GetDatabase(connectionNameOrUrl);
     this.collection     = database.GetCollection <TUser>(MongoDBUtilities.GetUserCollectionName());
     this.roleCollection = database.GetCollection <IdentityRole>(MongoDBUtilities.GetRoleCollectionName());
     this.disposed       = false;
 }
Exemple #2
0
        public RoleStore(String connectionNameOrUrl)
        {
            String roleCollectionName = MongoDBIdentitySettings.Settings != null ? MongoDBIdentitySettings.Settings.RoleCollectionName : "role";

            this.database   = MongoDBUtilities.GetDatabase(connectionNameOrUrl);
            this.collection = database.GetCollection <TRole>(MongoDBUtilities.GetRoleCollectionName());
            this.disposed   = false;
        }
Exemple #3
0
        public static void Initialize(String connectionNameOrUrl)
        {
            IMongoCollection <TUser> collection = MongoDBUtilities.GetDatabase(connectionNameOrUrl).GetCollection <TUser>(MongoDBUtilities.GetUserCollectionName());

            EnsureIndexes.UserStore <TUser>(collection);
        }