IronAlpine.Security.Authorization.EFCore 2.0.0

dotnet add package IronAlpine.Security.Authorization.EFCore --version 2.0.0
                    
NuGet\Install-Package IronAlpine.Security.Authorization.EFCore -Version 2.0.0
                    
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="IronAlpine.Security.Authorization.EFCore" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="IronAlpine.Security.Authorization.EFCore" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="IronAlpine.Security.Authorization.EFCore" />
                    
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 IronAlpine.Security.Authorization.EFCore --version 2.0.0
                    
#r "nuget: IronAlpine.Security.Authorization.EFCore, 2.0.0"
                    
#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 IronAlpine.Security.Authorization.EFCore@2.0.0
                    
#: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=IronAlpine.Security.Authorization.EFCore&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=IronAlpine.Security.Authorization.EFCore&version=2.0.0
                    
Install as a Cake Tool

IronAlpine.Security.Authorization.EFCore

EF Core provider for IronAlpine security permission projection storage and synchronization.

Why

This package productizes permission projection persistence so services do not copy repository code.

It provides:

  • Query store for permission checks (ISecurityPermissionStore).
  • Write-side sync store for projection updates (ISecurityPermissionProjectionSyncStore).
  • Contributor-based schema registration (SecurityPermissionModelContributor).

Install

dotnet add package IronAlpine.Security.Authorization.EFCore

Program.cs

builder.Services.AddIronAlpineAuthorizationEfCore<AppDbContext>(options =>
{
    options.PermissionProjectionTableName = "SecurityPermissionProjections";
    options.PermissionProjectionSchema = "security";
});

Or through security builder:

builder.Services
    .AddIronAlpineSecurityJwt(builder.Configuration)
    .WithAuthorizationStoreEfCore<AppDbContext>();

Configuration

Section: IronAlpine:Security:Authorization:EFCore

SecurityAuthorizationEfCoreOptions

  • PermissionProjectionTableName (string, default: "SecurityPermissionProjections")
    • Table mapped for SecurityPermissionProjection.
  • PermissionProjectionSchema (string?, default: null)
    • Optional schema name.

Registered Services

  • ISecurityPermissionStore → EfCoreSecurityPermissionStore<TDbContext>
  • ISecurityPermissionProjectionSyncStore → EfCoreSecurityPermissionProjectionSyncStore<TDbContext>
  • IModelContributor → SecurityPermissionModelContributor

How Sync Works

EfCoreSecurityPermissionProjectionSyncStore<TDbContext>:

  • ReplacePermissionsAsync:
    • Deletes existing rows for the group.
    • Inserts normalized rows (PermissionId, trimmed PermissionName).
    • De-duplicates by (PermissionGroupId, PermissionId).
  • DeleteGroupAsync:
    • Deletes all rows for group id.

If the projection entity is not registered in the model, methods no-op by design. This keeps owner contexts safe.

Migration Checklist

  1. Ensure AddIronAlpineAuthorizationEfCore<TDbContext>() is registered.
  2. Run migration add/update.
  3. Verify table exists:
    • SecurityPermissionProjections (or your configured table name).

Combination Patterns

  • Security.Authorization + Security.Authorization.EFCore
    • Complete permission check + sync pipeline.
  • Security.AspNetCore + Authorization.EFCore
    • Endpoint policy enforcement backed by EF projection.
  • Messaging + Authorization.EFCore
    • Permission group events drive projection sync via ISecurityPermissionProjectionSyncStore.

Troubleshooting

  • Projection table missing in migration
    • Ensure IronAlpine.Data.EFCore.Modeling is active in the service and contributor registration is not disabled.
  • Sync handler resolves no store
    • Verify package reference and AddIronAlpineAuthorizationEfCore<TDbContext>().
  • Duplicated permission rows
    • Validate incoming payload duplicates and ensure PermissionId is stable per permission.

Best Practices

  • Keep permission projection as read model in non-owner services.
  • Keep identity/owner context free of projection table if it is not required there.
  • Use event-driven sync with deterministic PermissionId and explicit event versioning.
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
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
2.0.0 502 4/2/2026
Loading failed

Stable mediator release with request/response, notification publish strategies, streaming, and dependency injection integration.