private static IRoleStore <AppRole> GetRoleCollection( string connectionString, string roleCollectionName = "AspNetRoles") { var database = MongoDbHelper.GetMongoDatabase(connectionString); var roleCollection = database.GetCollection <AppRole>(roleCollectionName); IndexChecker.EnsureAppRoleIndex(roleCollection).GetAwaiter().GetResult(); return(new AppRoleStore <AppRole>(roleCollection)); }
private static IUserStore <AppUser> GetUserCollection( string connectionString, string userCollectionName = "AspNetUsers") { var database = MongoDbHelper.GetMongoDatabase(connectionString); var userCollection = database.GetCollection <AppUser>(userCollectionName); IndexChecker.EnsureAppUserIndexes(userCollection).GetAwaiter().GetResult(); return(new AppUserStore <AppUser>(userCollection)); }