Architect.Identities.EntityFramework 1.0.0

EntityFramework extensions for the Architect.Identities package.

Use DbContext-based connections for the Fluid ID generator:

public void ConfigureServices(IServiceCollection services)
{
 services.AddPooledDbContextFactory<ExampleDbContext>(context => context.UseSqlServer("ConnectionString"));
 
 services.AddApplicationInstanceIdSource(source => source.UseSqlServerDbContext<ExampleDbContext>());
 
 services.AddIdGenerator(generator => generator.UseFluid());
}

Easily configure the column type to use for decimal ID columns:

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
 modelBuilder.Entity<Order>(entity =>
 {
   entity.Property(o => o.Id)
     .ValueGeneratedNever();
   
   entity.HasKey(o => o.Id);
 });
 
 // Other entities ...

 // For all mapped decimal columns named *Id or *ID
 modelBuilder.StoreDecimalIdsWithCorrectPrecision(dbContext: this);
}

Or per individual property:

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
 modelBuilder.Entity<Order>(entity =>
 {
   entity.Property(e => e.Id)
     .ValueGeneratedNever()
     .StoreWithDecimalIdPrecision(dbContext: this);
 });
}

The extensions in this package special-case SQLite, which requires special treatment.

Install-Package Architect.Identities.EntityFramework -Version 1.0.0
dotnet add package Architect.Identities.EntityFramework --version 1.0.0
<PackageReference Include="Architect.Identities.EntityFramework" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Architect.Identities.EntityFramework --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Architect.Identities.EntityFramework, 1.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Architect.Identities.EntityFramework as a Cake Addin
#addin nuget:?package=Architect.Identities.EntityFramework&version=1.0.0

// Install Architect.Identities.EntityFramework as a Cake Tool
#tool nuget:?package=Architect.Identities.EntityFramework&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 136 12/31/2020