CKN.Sdk.Data.RepoDb 0.0.0-alpha.0.55

This is a prerelease version of CKN.Sdk.Data.RepoDb.
dotnet add package CKN.Sdk.Data.RepoDb --version 0.0.0-alpha.0.55
                    
NuGet\Install-Package CKN.Sdk.Data.RepoDb -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.Data.RepoDb" 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.Data.RepoDb" Version="0.0.0-alpha.0.55" />
                    
Directory.Packages.props
<PackageReference Include="CKN.Sdk.Data.RepoDb" />
                    
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.Data.RepoDb --version 0.0.0-alpha.0.55
                    
#r "nuget: CKN.Sdk.Data.RepoDb, 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.Data.RepoDb@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.Data.RepoDb&version=0.0.0-alpha.0.55&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CKN.Sdk.Data.RepoDb&version=0.0.0-alpha.0.55&prerelease
                    
Install as a Cake Tool

CKN.Sdk.Data.RepoDb

Mühendislik Amacı (Engineering Intent): CKN.Sdk.Data.RepoDb, Dapper'ın yüksek performansını ve Entity Framework'ün (EF) kullanım kolaylığını aynı potada eriten bir mikro-ORM kütüphanesidir. Neden var? Dapper'da olduğu gibi her temel işlem (Insert, Update, Delete) için manuel SQL yazmak istemediğiniz, ancak EF Core'un hantallığını (özellikle bulk operasyonlardaki yavaşlığını) da yaşamak istemediğiniz durumlarda "Sweet Spot" (ideal nokta) olarak tasarlanmıştır. Ne zaman kullanılmalı? Toplu (Bulk) veri yazma işlemleri (BulkInsert, BulkUpdate vb.) yapmanız gereken background job/worker projelerinde veya projenin genelinde hem hız hem de fluent-API (SQL yazmadan sorgu atma) istendiğinde tercih edilmelidir.

🚀 Hızlı Başlangıç

Kurulum

dotnet add package CKN.Sdk.Data.RepoDb

Konfigürasyon (appsettings.json)

{
  "ConnectionStrings": {
    "DefaultConnection": "Server=localhost;Database=MyDatabase;Integrated Security=True;"
  }
}

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

using CKN.Sdk.Data.RepoDb;

var builder = WebApplication.CreateBuilder(args);

// RepoDb'yi SQL Server / PostgreSQL (projede belirtilen provider) modunda başlatır.
builder.Services.AddCknRepoDb(builder.Configuration.GetConnectionString("DefaultConnection"));

var app = builder.Build();

💡 Gerçek Hayat Senaryoları

Senaryo 1: Dinamik Sorgulama (Fluent API Kullanımı)

SQL cümlesi yazmadan strongly-typed şekilde veri filtrelemek.

using RepoDb;
using Microsoft.Data.SqlClient;

public class CustomerRepository(string connectionString)
{
    public async Task<IEnumerable<Customer>> GetActiveVIPCustomersAsync()
    {
        using var connection = new SqlConnection(connectionString);
        
        // RepoDb'nin QueryAsync metodu ile SQL yazmadan Dapper hızında filtreleme
        return await connection.QueryAsync<Customer>(c => c.IsActive == true && c.Status == "VIP");
    }
    
    public async Task<int> CreateCustomerAsync(Customer newCustomer)
    {
        using var connection = new SqlConnection(connectionString);
        // Insert işlemi (ID otomatik döner)
        return await connection.InsertAsync<Customer, int>(newCustomer);
    }
}

Senaryo 2: Yüksek Performanslı Toplu İşlem (Bulk Insert)

Örneğin bir Excel dosyasından okunan 50.000 satır veriyi saniyeler içinde veritabanına basmak.

public async Task ProcessMassiveDataAsync(List<Product> newProducts)
{
    using var connection = new SqlConnection(connectionString);
    
    // EF Core bu işlemi tek tek Insert'e çevirirken, RepoDb gerçek SqlBulkCopy kullanır.
    int rowsInserted = await connection.BulkInsertAsync(newProducts);
    
    Console.WriteLine($"{rowsInserted} adet ürün başarıyla eklendi.");
}

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

  • Soru: CKN.Sdk.Data.RepoDb paketini projemde Entity Framework Core yerine kullanabilir miyim?
  • Cevap: Evet. Eğer Navigation Properties (Include) ve karmaşık nesne ağacı (Change Tracking) izleme mekanizmalarına çok ihtiyacınız yoksa, performans açısından EF Core'un yerine rahatlıkla kullanılabilir.
  • Soru: RepoDb hangi veritabanlarını destekler?
  • Cevap: SQL Server, PostgreSQL, MySQL ve SQLite gibi popüler ilişkisel veritabanlarını destekler. Global SqlServerBootstrap.Initialize() metodunun DI kayıt aşamasında çağrılması unutulmamalıdır (Bu, AddCknRepoDb içerisinde otomatik yapılır).
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

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
0.0.0-alpha.0.55 51 9/28/2026
0.0.0-alpha.0.51 51 9/25/2026
0.0.0-alpha.0.50 50 9/25/2026
0.0.0-alpha.0.38 74 9/6/2026
0.0.0-alpha.0.37 70 9/6/2026