Path: redb/redb.SQLite/Providers/SqliteUserProvider.cs
Snapshot: redb, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb
Page: https://redbase.app/src/dev-2026-12-06/redb/redb.SQLite/Providers/SqliteUserProvider.cs
----
using redb.Core.Data;
using redb.Core.Models.Contracts;
using redb.Core.Providers.Base;
using redb.Core.Security;
using redb.SQLite.Sql;
using Microsoft.Extensions.Logging;
namespace redb.SQLite.Providers;
///
/// SQLite implementation of user provider.
/// Inherits all business logic from UserProviderBase.
/// Only provides SQLite-specific SQL dialect and password hasher.
///
/// Usage:
/// services.AddScoped<IUserProvider, SqliteUserProvider>();
///
public class SqliteUserProvider : UserProviderBase
{
///
/// Creates a new SQLite user provider.
///
/// Database context for executing queries
/// Security context for authorization
/// Optional logger for diagnostics
public SqliteUserProvider(
IRedbContext context,
IRedbSecurityContext securityContext,
ILogger? logger = null)
: base(context, securityContext, new SqliteDialect(), new BcryptPasswordHasher(), logger)
{
}
///
/// Creates a new SQLite user provider with custom password hasher.
///
/// Database context for executing queries
/// Security context for authorization
/// Custom password hasher implementation
/// Optional logger for diagnostics
public SqliteUserProvider(
IRedbContext context,
IRedbSecurityContext securityContext,
IPasswordHasher passwordHasher,
ILogger? logger = null)
: base(context, securityContext, new SqliteDialect(), passwordHasher, logger)
{
}
// All business logic is inherited from UserProviderBase.
// SQLite-specific SQL is provided by SqliteDialect.
// Password hashing is provided by IPasswordHasher - bcrypt by default (SimplePasswordHasher is
// only the legacy format, and BcryptPasswordHasher.VerifyPassword still accepts it).
}