BulutBusiness.Core 10.0.7

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

BulutBusiness.Core

.NET 10 tabanlı kurumsal iş uygulamaları için paylaşımlı altyapı kütüphanesi. Clean Architecture, CQRS ve Repository Pattern prensiplerine uygun olarak tasarlanmıştır.


Kurulum

dotnet add package BulutBusiness.Core

Modüller

Persistence — Repository & Entity

Generic EF Core repository implementasyonu. Tüm CRUD operasyonları, soft delete, sayfalama ve dinamik filtreleme desteklenir.

// Entity base sınıfı
public class Order : Entity<int> { ... }

// Repository
public class OrderRepository : EfRepositoryBase<Order, int, AppDbContext>, IOrderRepository { }

EfRepositoryBase<TEntity, TEntityId, TContext> metodları:

Metod Açıklama
AddAsync Ekle (CreatedDate otomatik set edilir)
UpdateAsync Güncelle (UpdatedDate otomatik set edilir)
DeleteAsync Sil — permanent: true kalıcı, varsayılan soft delete
GetAsync Tek kayıt getir
GetListAsync Sayfalı liste getir
GetListByDynamicAsync Dinamik filtreli liste
AnyAsync Varlık kontrolü

Soft Delete: DeletedDate set edilerek kayıt gizlenir. Cascade soft delete ilişkili kayıtlara otomatik uygulanır.

Timestamp davranışı: CreatedDate, UpdatedDate, DeletedDate alanları DateTime.Now ile set edilir. Container'da TZ ortam değişkeni ayarlıysa (örn. TZ=Europe/Istanbul) doğru yerel saat kaydedilir.

Sayfalama:

var result = await _orderRepository.GetListAsync(
    predicate: o => o.Status == OrderStatus.Active,
    orderBy: q => q.OrderByDescending(o => o.CreatedDate),
    index: 0,
    size: 20
);
// result.Items, result.Count, result.Pages, result.HasNext

Dinamik filtreleme:

var result = await _repository.GetListByDynamicAsync(
    dynamic: new DynamicQuery
    {
        Filter = new Filter { Field = "Status", Operator = "eq", Value = "1" },
        Sort = [new Sort { Field = "CreatedDate", Dir = "desc" }]
    }
);

Security — JWT & Kimlik Doğrulama

JWT token üretimi, refresh token yönetimi, şifre hashleme ve iki faktörlü kimlik doğrulama (Email OTP / TOTP).

// appsettings.json
{
  "TokenOptions": {
    "Audience": "myapp.com",
    "Issuer": "myapp.com",
    "AccessTokenExpiration": 60,
    "SecurityKey": "your-secret-key-min-32-chars"
  }
}
// Program.cs
builder.Services.AddSecurityServices();

Bileşenler:

Bileşen Açıklama
JwtHelper JWT access token üretir
HashingHelper HMACSHA512 ile şifre hash/verify
EmailAuthenticatorHelper E-posta OTP kodu üretir
OtpNetOtpAuthenticatorHelper TOTP (Google Authenticator uyumlu)
BearerSecurityRequirementOperationFilter Swagger'a otomatik Bearer ekler

Hazır Security Entity'leri: User, OperationClaim, UserOperationClaim, RoleGroup, RoleGroupOperationClaim, UserRoleGroup, RefreshToken, EmailAuthenticator, OtpAuthenticator

Yetki Grubu (RoleGroup)

10.0.7 ile eklenen grup tabanlı yetkilendirme sistemi. Kullanıcılara tek tek claim atamak yerine, claim'leri gruplar halinde yönetip kullanıcılara gruplar atanabilir. Bir kullanıcı birden fazla gruba üye olabilir; token oluşturulurken tüm grupların claim'leri düzleştirilerek (flatten) birleştirilir.

RoleGroup ("Satın Alma Yöneticisi")
  ├─ PurchaseQuotes.Read
  ├─ PurchaseQuotes.Create
  └─ PurchaseInvoices.Read

Kullanıcı: Ahmet
  ├─ Grup: "Satın Alma Yöneticisi"
  └─ Grup: "Stok Görevlisi"

Token'daki roller (flatten + distinct):
  ["PurchaseQuotes.Read", "PurchaseQuotes.Create", "PurchaseInvoices.Read", "Stock.Read", ...]
// Domain'de extend et (navigation property'ler burada tanımlanır)
public class RoleGroup : RoleGroup<Guid> { }
public class RoleGroupOperationClaim : RoleGroupOperationClaim<Guid, Guid, int> { }
public class UserRoleGroup : UserRoleGroup<Guid, Guid, Guid> { }
// Token oluştururken — ITokenHelper overload
var directClaims   = await _userOpClaimRepo.GetClaimsAsync(userId);
var userGroups     = await _userRoleGroupRepo.GetGroupsAsync(userId);
var groupClaims    = await _roleGroupClaimRepo.GetClaimsByGroupsAsync(groupIds);

var token = _tokenHelper.CreateToken(user, directClaims, userGroups, groupClaims);

Pasif grup davranışı: IsActive = false olan gruplar token'a claim eklemez; bu sayede bir grubun tüm kullanıcı yetkilerini tek seferde askıya alabilirsiniz.


Application — CQRS Pipeline Behavior'ları

MediatR pipeline üzerinde çalışan cross-cutting concern davranışları.

Behavior Interface Açıklama
AuthorizationBehavior ISecuredRequest Rol/claim tabanlı yetkilendirme
CachingBehavior ICachableRequest In-memory önbellekleme
CacheRemovingBehavior ICacheRemoverRequest Cache invalidation
LoggingBehavior ILoggableRequest İstek/yanıt loglama
PerformanceBehavior IIntervalRequest Yavaş sorgu uyarısı
TransactionScopeBehavior ITransactionalRequest Transaction scope
RequestValidationBehavior FluentValidation entegrasyonu
// Yetkilendirme örneği
public class DeleteProductCommand : IRequest<Unit>, ISecuredRequest
{
    public string[] Roles => ["Admin", "Manager"];
}

// Önbellekleme örneği
public class GetProductsQuery : IRequest<GetListResponse<ProductDto>>, ICachableRequest
{
    public string CacheKey => "Products";
    public TimeSpan? SlidingExpiration => TimeSpan.FromMinutes(30);
}

Mailing — E-posta Gönderimi

MailKit tabanlı HTML e-posta gönderimi.

// appsettings.json
{
  "MailSettings": {
    "Server": "smtp.example.com",
    "Port": 587,
    "SenderFullName": "example",
    "SenderEmail": "noreply@example.com",
    "UserName": "noreply@example.com",
    "Password": "app-password",
    "UseSsl": false
  }
}
await _mailService.SendEmailAsync(new Mail
{
    Subject = "Siparişiniz alındı",
    HtmlBody = "<h1>Teşekkürler!</h1>",
    ToList = [new ToEmail { Address = "customer@example.com", Name = "Ad Soyad" }]
});

ElasticSearch

NEST tabanlı ElasticSearch entegrasyonu. Index oluşturma, belge ekleme/güncelleme, arama işlemleri.

// appsettings.json
{
  "ElasticSearchConfig": {
    "ConnectionString": "http://localhost:9200",
    "UserName": "",
    "Password": ""
  }
}

Localization — Çoklu Dil Desteği

İki farklı lokalizasyon stratejisi:

  • ResourceLocalizationManager.resx dosyası tabanlı, yerel çeviri
  • AmazonTranslateLocalizationManager — AWS Translate ile otomatik çeviri
  • TranslateLocalizationManager — Karma strateji
// Program.cs
app.UseMiddleware<LocalizationMiddleware>(); // Accept-Language header'ına göre dil ayarlar

CrossCuttingConcerns — Hata Yönetimi & Loglama

Exception Middleware: BusinessException, AuthorizationException, NotFoundException, ValidationException tiplerini yakalar ve RFC 7807 uyumlu ProblemDetails döner.

Serilog Loglama:

// appsettings.json
{
  "SeriLogConfigurations": {
    "FileLogConfiguration": {
      "FolderPath": "/logs"
    }
  }
}

Versiyon Geçmişi

10.0.7

  • Yetki Grubu (RoleGroup) altyapısı eklendi
    • RoleGroup<TId>Name, Description, IsActive alanlarıyla yetki grubu entity'si
    • RoleGroupOperationClaim<TId, TRoleGroupId, TOperationClaimId> — grup ↔ claim N:N köprüsü
    • UserRoleGroup<TId, TUserId, TRoleGroupId> — kullanıcı ↔ grup N:N köprüsü
  • ITokenHelper yeni overloadCreateToken(user, directClaims, roleGroups, roleGroupClaims): aktif grupların claim'lerini otomatik flatten + distinct ederek token'a yazar; geriye dönük uyumlu (eski imza korundu)
  • Navigation property'ler Core entity'lerine eklenmedi — bağımlılıkları sıfır tutar, uygulama katmanı kendi Domain entity'lerinde tanımlar

10.0.6

  • EfRepositoryBase: CreatedDate, UpdatedDate, DeletedDate timestamp'leri DateTime.UtcNowDateTime.Now olarak değiştirildi. Container TZ ortam değişkeni ile yerel saat desteği sağlandı.
  • Paket güncellemeleri: FluentValidation 12.1.1, MailKit 4.15.1, MediatR 14.1.0, EF Core 10.0.5, Microsoft.IdentityModel.Tokens 8.17.0, Swashbuckle 10.1.7, Otp.NET 1.4.1, Serilog 4.3.1

10.0.5

  • .NET 10 desteği
  • MimeKit 4.14.1, EF Core 10.0.2

10.0.x (önceki)

  • .NET 9 → .NET 10 geçişi
  • JWT, Repository, CQRS pipeline altyapısı

Gereksinimler

  • .NET 10+
  • Entity Framework Core 10 uyumlu veritabanı (SQL Server, PostgreSQL vb.)
  • (Opsiyonel) ElasticSearch 7.x
  • (Opsiyonel) AWS hesabı (Amazon Translate için)
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
10.0.7 63 4/9/2026
10.0.6 191 4/5/2026
10.0.5 333 1/31/2026
10.0.4 95 1/31/2026
10.0.3 96 1/31/2026
10.0.2 100 1/31/2026
10.0.1 104 1/31/2026
10.0.0 144 11/29/2025
1.0.5 255 7/13/2025
1.0.4 453 6/9/2025
1.0.3 198 6/1/2025
1.0.2 253 4/22/2025
1.0.1 225 4/22/2025
1.0.0 203 4/21/2025