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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Lewee.Auth.Infrastructure.Data" Version="0.40.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lewee.Auth.Infrastructure.Data" Version="0.40.3" />
                    
Directory.Packages.props
<PackageReference Include="Lewee.Auth.Infrastructure.Data" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Lewee.Auth.Infrastructure.Data --version 0.40.3
                    
#r "nuget: Lewee.Auth.Infrastructure.Data, 0.40.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Lewee.Auth.Infrastructure.Data@0.40.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Lewee.Auth.Infrastructure.Data&version=0.40.3
                    
Install as a Cake Addin
#tool nuget:?package=Lewee.Auth.Infrastructure.Data&version=0.40.3
                    
Install as a Cake Tool

Lewee.Auth.Infrastructure.Data

Entity Framework Core persistence for Lewee authentication and multi-tenant authorization data.

Features

  • Dedicated AuthDbContext with the auth default 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

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 Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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