NetCoreBackend.NArchitecture.Core.Application 1.0.1

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

Core.Application

CQRS ve MediatR tabanlı uygulama katmanı altyapısı. Request pipeline behavior'ları, DTO base sınıfları ve iş kuralı doğrulama mekanizmaları içerir.

Pipeline Behaviors

Request'e ilgili interface eklenerek behavior aktif edilir:

Behavior Interface Açıklama
AuthorizationBehavior ISecuredRequest Rol tabanlı yetkilendirme. SuperAdmin tüm kontrolleri atlar (SuperAdmin gating için Roles = ["SuperAdmin"]).
SuperAdminBlockBehavior IBlockedForSuperAdmin PlatformAdmin (impersonate etmeden) endpoint'i çağırırsa reddeder. Tenant-user-only operasyonlar için.
RequestValidationBehavior otomatik FluentValidation ile request doğrulama (ValidationException → 400)
CachingBehavior ICachableRequest Distributed cache. Key'e tenant prefix otomatik eklenir.
CacheRemovingBehavior ICacheRemoverRequest Cache grubu temizleme
TransactionScopeBehavior ITransactionalRequest İşlem başarısız olursa rollback
LoggingBehavior ILoggableRequest Request/response log. ISensitiveRequest implement edilirse payload "[redacted]" loglanır.
PerformanceBehavior IIntervalRequest Yavaş request uyarısı
TenantValidationBehavior ITenantValidationRequest Tenant context olmadan request reddedilir

Cache key kuralı: ICachableRequest.CacheKey consuming app'te benzersiz olmalı. Framework key'leri t:<tenantId>:<CacheKey> formatında prefix'liyor ama farklı handler'lar aynı CacheKey değerini kullanırsa cache çakışması ve deserialization hatası yaşanır. Konvansiyon: "Products:GetAll", "Products:ById:{id}", asla yalın "Products".

ISensitiveRequest: Şifre, token, kredi kartı vb. veri taşıyan command'lara uygulayın — LoggingBehavior payload'ı redact eder, sadece request tipi loglanır.

Kullanım

// Secured + cached + tenant-validated bir query örneği
public class GetProductsQuery : IRequest<GetListResponse<ProductDto>>,
    ISecuredRequest,
    ICachableRequest,
    ITenantValidationRequest
{
    public string[] Roles => ["Manager", "Admin"];
    // CacheKey query handler içinde benzersiz olmalı — bare "Products" değil,
    // sorgu+parametre kimliğini yansıtan bir değer kullan (örn. "Products:GetAll").
    public string CacheKey => "Products:GetAll";
    public string? CacheGroupKey => "Products";
    public bool BypassCache => false;
    public TimeSpan? SlidingExpiration => null;
}

Bağımlılıklar

  • Core.Security — yetkilendirme ve claim extension'ları
  • Core.MultiTenancy — ITenantContext ve tenant claim'leri
  • Core.CrossCuttingConcerns.Exception — AuthorizationException
  • Core.CrossCuttingConcerns.Logging — LogDetail, LogParameter
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.0.1 31 6/9/2026
1.0.0 52 6/2/2026