Lewee.Auth.Infrastructure.Data
0.40.3
dotnet add package Lewee.Auth.Infrastructure.Data --version 0.40.3
NuGet\Install-Package Lewee.Auth.Infrastructure.Data -Version 0.40.3
<PackageReference Include="Lewee.Auth.Infrastructure.Data" Version="0.40.3" />
<PackageVersion Include="Lewee.Auth.Infrastructure.Data" Version="0.40.3" />
<PackageReference Include="Lewee.Auth.Infrastructure.Data" />
paket add Lewee.Auth.Infrastructure.Data --version 0.40.3
#r "nuget: Lewee.Auth.Infrastructure.Data, 0.40.3"
#:package Lewee.Auth.Infrastructure.Data@0.40.3
#addin nuget:?package=Lewee.Auth.Infrastructure.Data&version=0.40.3
#tool nuget:?package=Lewee.Auth.Infrastructure.Data&version=0.40.3
Lewee.Auth.Infrastructure.Data
Entity Framework Core persistence for Lewee authentication and multi-tenant authorization data.
Features
- Dedicated
AuthDbContextwith theauthdefault schema - Separate tables for users, tenants, and tenant memberships
- Unique external user identities
- Unique tenant codes with a maximum length of 10 characters
- Unique user/tenant membership pairs
- Lewee audit, soft-delete, domain-event outbox, and query-projection support
Dependencies
- Lewee.Auth.Domain for auth aggregates
- Lewee.Infrastructure.Data for EF Core and repository infrastructure
Npgsql.EntityFrameworkCore.PostgreSQLfor PostgreSQL persistence
Configuration
Register the context and Lewee database services in an ASP.NET Core host:
using Lewee.Auth.Domain;
using Lewee.Auth.Infrastructure.Data;
using Lewee.Infrastructure.Data;
using Lewee.Infrastructure.PostgreSQL;
services
.AddLeweePostgreSQL<AuthDbContext>(
connectionString,
typeof(User).Assembly,
AuthDbContext.SchemaName)
.AddLeweeDatabaseServices<AuthDbContext>(typeof(User).Assembly);
Apply the included migrations before serving requests:
await serviceProvider.MigrateDatabaseAsync<AuthDbContext>(
seedData: true,
cancellationToken);
Register an IDatabaseSeeder<AuthDbContext> when application-specific initial users, tenants, or memberships are
required.
Database Model
| Table | Purpose | Important constraints |
|---|---|---|
auth.Tenants |
Stores tenant aggregates | Unique Code |
auth.Users |
Stores user aggregates | Unique ExternalId |
auth.UserTenantMemberships |
Stores user-to-tenant relationships | Unique (UserId, TenantId) |
The initial migration also preserves legacy users by copying existing sto.Users rows into auth.Users before the
sample store migration removes the source table.
Main Types
| Type | Purpose |
|---|---|
AuthDbContext |
EF Core context for auth data |
TenantConfiguration |
Configures tenant properties and unique code |
UserConfiguration |
Configures users and owned tenant memberships |
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Lewee.Auth.Domain (>= 0.40.3)
- Lewee.Infrastructure.Data (>= 0.40.3)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 11.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.40.3 | 45 | 11/22/2026 |