CKN.Sdk.Data.RepoDb
0.0.0-alpha.0.55
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
<PackageReference Include="CKN.Sdk.Data.RepoDb" Version="0.0.0-alpha.0.55" />
<PackageVersion Include="CKN.Sdk.Data.RepoDb" Version="0.0.0-alpha.0.55" />
<PackageReference Include="CKN.Sdk.Data.RepoDb" />
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"
#:package CKN.Sdk.Data.RepoDb@0.0.0-alpha.0.55
#addin nuget:?package=CKN.Sdk.Data.RepoDb&version=0.0.0-alpha.0.55&prerelease
#tool nuget:?package=CKN.Sdk.Data.RepoDb&version=0.0.0-alpha.0.55&prerelease
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.RepoDbpaketini 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,AddCknRepoDbiçerisinde otomatik yapılır).
| Product | Versions 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. |
-
net10.0
- CKN.Sdk.Core (>= 0.0.0-alpha.0.55)
- RepoDb (>= 1.15.1)
- RepoDb.PostgreSql (>= 1.15.0)
-
net8.0
- CKN.Sdk.Core (>= 0.0.0-alpha.0.55)
- RepoDb (>= 1.15.1)
- RepoDb.PostgreSql (>= 1.15.0)
-
net9.0
- CKN.Sdk.Core (>= 0.0.0-alpha.0.55)
- RepoDb (>= 1.15.1)
- RepoDb.PostgreSql (>= 1.15.0)
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 |