GetDatabase() public static method

public static GetDatabase ( String connectionNameOrUrl ) : IMongoDatabase
connectionNameOrUrl String
return IMongoDatabase
コード例 #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;
 }
コード例 #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;
        }
コード例 #3
0
        public static void Initialize(String connectionNameOrUrl)
        {
            IMongoCollection <TUser> collection = MongoDBUtilities.GetDatabase(connectionNameOrUrl).GetCollection <TUser>(MongoDBUtilities.GetUserCollectionName());

            EnsureIndexes.UserStore <TUser>(collection);
        }