Mecesoft.Data.EntityFrameworkCore.PostgreSql.Tenancy 1.1.0

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

Mecesoft.Data.EntityFrameworkCore.PostgreSql.Tenancy

Mecesoft.Data 1.1.0 ile standart DbContext, IdentityDbContext ve Mecesoft.Repository uyumluluk katmanı desteklenir. Bu paket yalnızca row-per-tenant production collation/relationship doğrulaması için gereklidir; tenant kullanmayan veya DB-per-tenant uygulamalar bu pakete ihtiyaç duymaz.

Opsiyonel PostgreSQL production tenant collation doğrulama paketi.

Kapsam

Bu paket yalnızca PostgreSQL'e özgü ITenantCollationVerifier implementasyonunu sağlar. Ana Mecesoft.Data.EntityFrameworkCore paketi provider-neutral kalır.

Kullanım

optionsBuilder
    .UseNpgsql(connectionString)
    .UseMecesoftPostgreSqlTenancy();

Tek API trusted production verifier'ı kurar. String tenant mapping varken bu yapılandırma eksikse model/startup doğrulaması fail-closed olur.

Doğrulama kuralları

  • Tenant property gerçek EF table/column mapping metadata'sından çözülür. Tenant property ITenantEntity<T>.TenantId contract property'si olmalıdır.
  • Custom schema, quoted identifier ve HasColumnName desteklenir.
  • Explicit schema yoksa search_path üzerinden gerçek görünür şema çözülür; hardcoded public fallback'i güvenlik kanıtı olarak kullanılmaz. Şema çözülemez veya belirsizse fail-closed olur.
  • Custom string mapping'ler ITenantExactMapping marker'ını taşımalıdır; taşımıyorsa fail-closed olur.
  • Marker tek başına güvenlik kanıtı değildir: core, custom BuildFilter'ın doğrudan tenant property eşitliği içerdiğini ve mapping metadata'sının model oluşturulmadan önce snapshot alındığını doğrular. entity => true, başka property veya ek predicate kullanan filter'lar model oluşturma aşamasında reddedilir.
  • Yalnızca regular veya partitioned table (pg_class.relkind r/p) kabul edilir.
  • Yalnızca text/varchar kabul edilir.
  • pg_attribute.atttypmod doğrulanır: text, limitsiz varchar veya en az 128 karakterlik varchar(n) kabul edilir; daha küçük kapasiteli kolonlar fail-closed reddedilir.
  • citext, bpchar, domain ve diğer custom type'lar reddedilir.
  • Generated/computed tenant column reddedilir.
  • View, materialized view, foreign table reddedilir.
  • Yalnızca pg_collation.collisdeterministic = true kabul edilir.
  • Non-deterministic ICU collation reddedilir.
  • Model foreign key delete action'ları pg_constraint/pg_class/pg_namespace ile schema-qualified olarak karşılaştırılır. Modelde bulunmayan veya modelle uyuşmayan ON DELETE CASCADE/SET NULL/SET DEFAULT fail-closed reddedilir. Eksik/ambiguous metadata doğrulamayı durdurur.
  • Catalog sorgusu parametreledir; identifier interpolation kullanılmaz.

PostgreSQL deterministic collation'larda eşitlik byte-wise'dır ve trailing space'ler anlamlıdır; SQL Server'daki exactness augmenter'ı PostgreSQL'e uygulanmaz.

Startup

using var scope = services.CreateScope();
var context = scope.ServiceProvider.GetRequiredService<AppDbContext>();
context.ValidateTenantSecurity();

String tenant kullanılıyorsa schema hazır olduktan sonra çağrılmalıdır.

Kapsam dışı

  • xmin concurrency token desteği değiştirilmez; mevcut fail-closed davranışı korunur.
  • Raw SQL, bulk ve IgnoreQueryFilters named tenant filter'ı atlar.
  • Paket mevcut veriyi taramaz veya normalize etmez.
Product 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. 
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
1.1.0 42 10/25/2026
1.0.0 38 10/25/2026

1.1.0: restores Mecesoft.Repository compatibility, standard/Identity DbContext support, general-purpose unit of work, detached concurrency helpers, and optional soft-delete/audit services.