public UserService(IUserStoreDatabaseSettings settings)
        {
            var client   = new MongoClient(settings.ConnectionString);
            var database = client.GetDatabase(settings.DatabaseName);

            _users = database.GetCollection <User>(settings.UserCollectionName);
        }
Exemple #2
0
        public UserService(IUserStoreDatabaseSettings settings,
                           IOptions <CommonSettings> commonSettings,
                           DatabaseEncryptionService encryptionService,
                           IRoleService roleService)
        {
            _roleService       = roleService;
            _identitySettings  = commonSettings.Value.IdentitySettings;
            _encryptionService = encryptionService;
            var client   = new MongoClient(settings.ConnectionString);
            var database = client.GetDatabase(settings.DatabaseName);

            _users = database.GetCollection <DbUser>(settings.UsersCollectionName);
        }