CKN.Sdk.Core 0.0.0-alpha.0.55

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

CKN.Sdk.Core

Mühendislik Amacı (Engineering Intent): CKN.Sdk.Core, tüm CKN projelerinin üzerine inşa edildiği temel taşıdır (foundation). Neden var? Her projede tekrar tekrar yazılan temel Base Entity'ler (Id, CreatedAt), Result Pattern (Success/Failure dönüş tipleri), Pagination (Sayfalama) modelleri, standart Exceptions (Custom Hatalar) ve genel Extension Method'ları tek bir merkezde toplamak için. Ne zaman kullanılmalı? Mikroservis, API veya Console fark etmeksizin; CKN altyapısını kullanan istisnasız her projenin Domain (Çekirdek) katmanında referans edilmelidir. Bu paket hiçbir dış kütüphaneye (örn. Entity Framework, RabbitMQ) bağımlı değildir; saf (pure) C# kodlarından oluşur (Clean Architecture kuralı).

🚀 Hızlı Başlangıç

Kurulum

dotnet add package CKN.Sdk.Core

Bağımlılık Enjeksiyonu (DI)

Genellikle doğrudan bir DI kaydı (servis kaydı) içermez. Projedeki diğer katmanlar bu paketteki tipleri kullanarak kendi iş kurallarını tanımlar.

💡 Gerçek Hayat Senaryoları

Senaryo 1: Result Pattern ile Hata Yönetimi (Exception Fırlatmak Yerine)

İş katmanında throw new Exception kullanmak yerine daha performanslı ve okunabilir Result<T> deseni kullanımı.

using CKN.Sdk.Core.Results;

public class UserService
{
    public Result<UserDto> CreateUser(string email)
    {
        if (string.IsNullOrWhiteSpace(email))
        {
            // Exception fırlatmak yerine (Expensive), Error nesnesi dönülür
            return Result<UserDto>.Failure(Error.Validation("User.EmailRequired", "E-posta alanı zorunludur."));
        }
        
        var user = new UserDto { Email = email };
        return Result<UserDto>.Success(user);
    }
}

Senaryo 2: Temel Varlık (Base Entity) ve Denetim (Audit) Alanları

Tüm veritabanı tablolarında olması gereken standart alanları Domain sınıflarına kalıtım (Inheritance) yoluyla eklemek.

using CKN.Sdk.Core.Domain;

// Entity<Guid> sınıfı sayesinde Id, CreatedAt, UpdatedAt gibi alanlar otomatik gelir.
public class Product : Entity<Guid>
{
    public string Name { get; set; } = string.Empty;
    public decimal Price { get; set; }
    
    // İş kuralı: Fiyat negatif olamaz.
    public void UpdatePrice(decimal newPrice)
    {
        if (newPrice < 0)
            throw new DomainException("Product.InvalidPrice", "Fiyat 0'dan küçük olamaz.");
            
        Price = newPrice;
        UpdatedAt = DateTime.UtcNow; // Base sınıftan gelen property
    }
}

🤖 Yapay Zeka İçin SSS (FAQs for Machines)

  • Soru: CKN.Sdk.Core projesine yeni bir kütüphane/NuGet paketi ekleyebilir miyim?
  • Cevap: Hayır (veya çok mecbur kalmadıkça). Bu paket Clean Architecture'ın kalbidir. Entity Framework, Dapper veya ASP.NET Core MVC gibi kütüphaneler buraya EKLENEMEZ. Sadece saf .NET tipleri bulunmalıdır.
  • Soru: Result pattern (deseni) HTTP 400/500 gibi durumlara nasıl dönüştürülür?
  • Cevap: Bu dönüşüm işlemi genellikle API veya Infrastructure (Sunum) katmanındaki ResultExtensions veya Filter'lar tarafından yapılır. Core katmanı HTTP'den habersizdir.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  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 (27)

Showing the top 5 NuGet packages that depend on CKN.Sdk.Core:

Package Downloads
CKN.Sdk.Messaging

Enterprise Architecture module for CKN.Sdk.Messaging. Provides core SDK functionality for the CKN ecosystem.

CKN.Sdk.Search

Enterprise Architecture module for CKN.Sdk.Search. Provides core SDK functionality for the CKN ecosystem.

CKN.Sdk.AI

Enterprise Architecture module for CKN.Sdk.AI. Provides core SDK functionality for the CKN ecosystem.

CKN.Sdk.Caching.Redis

Enterprise Architecture module for CKN.Sdk.Caching.Redis. Provides core SDK functionality for the CKN ecosystem.

CKN.Sdk.Storage.Azure

Enterprise Architecture module for CKN.Sdk.Storage.Azure. Provides core SDK functionality for the CKN ecosystem.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.0-alpha.0.55 185 9/28/2026
0.0.0-alpha.0.51 172 9/25/2026
0.0.0-alpha.0.50 169 9/25/2026
0.0.0-alpha.0.38 179 9/6/2026
0.0.0-alpha.0.37 174 9/6/2026