EFGenericUnitOfWork 1.0.41

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

EFGenericUnitOfWork

Bu kütüphane, Entity Framework Core ile birlikte kullanılmak üzere tasarlanmış Generic Unit of Work ve Repository yapılarını sağlar.

🚀 Kurulum

dotnet add package Microsoft.EntityFrameworkCore
dotnet add package Microsoft.EntityFrameworkCore.SqlServer
dotnet add package Microsoft.AspNetCore.Identity.EntityFrameworkCore

⚙️ Program.cs Entegrasyonu

Temel Kullanım

builder.Services.AddDbContext<BaseDbContext>(options =>
    options.UseSqlServer(builder.Configuration.GetConnectionString("MsSqlTallyGoDb")));

builder.Services.AddScoped<IUnitOfWork, UnitOfWork<BaseDbContext>>();

Birden Fazla DbContext ile Kullanım

// DbContext kayıtları
builder.Services.AddDbContext<BaseDbContext>();
builder.Services.AddDbContext<MikroMainDbContext>();

// UnitOfWork kayıtları
builder.Services.AddScoped<IUnitOfWork>(sp =>
{
    var context = sp.GetRequiredService<BaseDbContext>();
    return new UnitOfWork<BaseDbContext>(context);
});

builder.Services.AddScoped<IUnitOfWork>(sp =>
{
    var context = sp.GetRequiredService<MikroMainDbContext>();
    return new UnitOfWork<MikroMainDbContext>(context);
});

Dinamik DbContext Factory Kullanımı

public interface IMikroDbContextFactory
{
    MikroDbContext CreateDbContext(string databaseName);
}

public class MikroDbContextFactory : IMikroDbContextFactory
{
    private readonly IConfiguration _configuration;

    public MikroDbContextFactory(IConfiguration configuration)
    {
        _configuration = configuration;
    }

    public MikroDbContext CreateDbContext(string databaseName)
    {
        return new MikroDbContext(databaseName, _configuration);
    }
}

Servis kaydı:

builder.Services.AddScoped<IMikroDbContextFactory, MikroDbContextFactory>();

Identity Kullanımı (Opsiyonel)

Eğer IdentityUser kullanıyorsanız aşağıdaki konfigürasyon eklenmelidir:

builder.Services.AddIdentity<Kullanicilar, AppRole>(opt =>
{
    opt.Password.RequireNonAlphanumeric = true;
    opt.Password.RequireDigit = true;
})
.AddEntityFrameworkStores<BaseDbContext>();

Identity kullanmıyorsanız bu kayıt zorunlu değildir.


📝 Notlar

  • UnitOfWork<TContext> yapısı her tür DbContext ile uyumlu çalışır.
  • Soft delete, transaction, paging, aggregate fonksiyonları gibi genişletilebilir özelliklerle desteklenebilir.
  • Kütüphane temiz bir altyapı sağlayarak kodun test edilebilirliğini ve sürdürülebilirliğini artırır.

📧 İletişim

Herhangi bir öneri veya katkı için bizimle iletişime geçmekten çekinmeyin.

EMF BİLGİSAYAR YAZILIM YÖNETİM VE DANIŞMANLIK HİZMETLERİ
📧 mehmetseyitoglu@emfyazilim.com
🌐 www.emfyazilim.com

Product Compatible and additional computed target framework versions.
.NET 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 was computed.  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 (1)

Showing the top 1 NuGet packages that depend on EFGenericUnitOfWork:

Package Downloads
EmfGlobalCaching

A global caching library with support for MediatR, Memory Caching, and Redis Caching, enhancing performance and scalability.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.41 112 7/27/2025
1.0.40 109 7/27/2025
1.0.39 110 7/27/2025
1.0.38 122 7/26/2025
1.0.37 125 7/26/2025
1.0.36 164 7/26/2025
1.0.35 189 7/26/2025
1.0.34 201 7/26/2025
1.0.33 197 7/26/2025
1.0.32 364 3/24/2025
1.0.31 269 3/23/2025
1.0.30 183 3/11/2025
1.0.29 168 3/11/2025
1.0.28 213 3/5/2025
1.0.27 114 2/18/2025
1.0.26 115 2/18/2025
1.0.25 114 2/17/2025
1.0.24 100 2/17/2025
1.0.23 111 2/17/2025
1.0.22 116 2/16/2025
1.0.21 110 2/16/2025
1.0.20 106 1/30/2025
1.0.19 152 9/9/2024
1.0.18 179 7/12/2024
1.0.17 113 7/11/2024
1.0.16 103 7/11/2024
1.0.14 118 7/11/2024
1.0.13 118 7/11/2024
1.0.12 124 7/9/2024
1.0.11 124 7/9/2024
1.0.10 129 7/6/2024
1.0.9 137 7/6/2024
1.0.8 117 7/6/2024
1.0.7 119 7/6/2024
1.0.6 121 7/6/2024
1.0.5 112 7/6/2024
1.0.4 130 7/2/2024
1.0.3 131 7/1/2024
1.0.1 138 7/1/2024 1.0.1 is deprecated because it has critical bugs.
1.0.0 134 7/1/2024 1.0.0 is deprecated because it has critical bugs.

Initial release with support for Entity Framework Core, Repository Pattern, UnitOfWork Pattern, SoftDelete functionality, paging, and synchronous/asynchronous support.