JoinRpg.Common.EntityFrameworkCore
2026.9.533
See the version list below for details.
dotnet add package JoinRpg.Common.EntityFrameworkCore --version 2026.9.533
NuGet\Install-Package JoinRpg.Common.EntityFrameworkCore -Version 2026.9.533
<PackageReference Include="JoinRpg.Common.EntityFrameworkCore" Version="2026.9.533" />
<PackageVersion Include="JoinRpg.Common.EntityFrameworkCore" Version="2026.9.533" />
<PackageReference Include="JoinRpg.Common.EntityFrameworkCore" />
paket add JoinRpg.Common.EntityFrameworkCore --version 2026.9.533
#r "nuget: JoinRpg.Common.EntityFrameworkCore, 2026.9.533"
#:package JoinRpg.Common.EntityFrameworkCore@2026.9.533
#addin nuget:?package=JoinRpg.Common.EntityFrameworkCore&version=2026.9.533
#tool nuget:?package=JoinRpg.Common.EntityFrameworkCore&version=2026.9.533
JoinRpg.Common.EntityFrameworkCore
Хранит типизированные Id из JoinRpg.Common.PrimitiveTypes (и свои, сгенерированные
[TypedEntityId]) в колонках EF Core как обычные числа.
dotnet add package JoinRpg.Common.EntityFrameworkCore
Нужен net10.0 и EF Core 10.
using JoinRpg.Common.EntityFrameworkCore;
using JoinRpg.Common.PrimitiveTypes;
public class MyDbContext(DbContextOptions options) : DbContext(options)
{
protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)
{
// GameIdentification — свой [TypedEntityId] с одним int
configurationBuilder.Properties<GameIdentification>()
.HaveEntityIdValueConversion<GameIdentification, int>();
configurationBuilder.Properties<UserIdentification>()
.HaveEntityIdValueConversion<UserIdentification, int>();
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
// ... настройка сущностей ...
// Ключ с конвертером EF сам identity не делает — включаем, как у int-ключа.
modelBuilder.EntityIdsSetValueGeneratedOnAdd();
}
}
HaveEntityIdValueConversion<TId, TValue>()— вызывать вConfigureConventions. Без конвертера EF примет свойство такого типа за навигацию к новой сущности.TValue(intилиlong) указывается явно, вывести его компилятор не может.EntityIdsSetValueGeneratedOnAdd()— вызывать в концеOnModelCreating: сущности, настроенные после вызова, он не затронет. Делает identity все ключи из одного типизированного Id, в том числе внешние (UserIdentificationс id.joinrpg.ru) — таким после вызова вернитеValueGeneratedNever().
Составные Id (GamePlayerId(5-12)) конвертера не получают: храните их части отдельными
колонками.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- JoinRpg.Common.PrimitiveTypes (>= 2026.9.533)
- Microsoft.EntityFrameworkCore (>= 10.0.14)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on JoinRpg.Common.EntityFrameworkCore:
| Package | Downloads |
|---|---|
|
JoinRpg.Common.WebInfrastructure
ASP.NET Core web infrastructure: Serilog logging, OpenTelemetry, EF Core data protection in PostgreSQL, health checks, midnight job scheduler (contracts in JoinRpg.Common.WebInfrastructure.Interfaces), OIDC login against id.joinrpg.ru. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2026.9.680 | 310 | 11/8/2026 |
| 2026.9.668 | 165 | 11/8/2026 |
| 2026.9.651 | 210 | 11/7/2026 |
| 2026.9.533 | 638 | 10/29/2026 |
| 2026.9.438 | 218 | 10/27/2026 |
| 2026.9.363 | 103 | 10/22/2026 |
| 2026.9.217 | 115 | 10/16/2026 |
| 2026.8.421 | 139 | 10/4/2026 |
| 2026.8.383 | 130 | 10/4/2026 |
| 2026.8.256 | 266 | 9/29/2026 |
| 2026.8.12 | 253 | 9/6/2026 |
| 2026.8.0 | 172 | 9/2/2026 |
| 2026.7.34 | 131 | 8/26/2026 |
| 2026.7.32 | 134 | 8/26/2026 |