BulutBusiness.Core
10.0.7
dotnet add package BulutBusiness.Core --version 10.0.7
NuGet\Install-Package BulutBusiness.Core -Version 10.0.7
<PackageReference Include="BulutBusiness.Core" Version="10.0.7" />
<PackageVersion Include="BulutBusiness.Core" Version="10.0.7" />
<PackageReference Include="BulutBusiness.Core" />
paket add BulutBusiness.Core --version 10.0.7
#r "nuget: BulutBusiness.Core, 10.0.7"
#:package BulutBusiness.Core@10.0.7
#addin nuget:?package=BulutBusiness.Core&version=10.0.7
#tool nuget:?package=BulutBusiness.Core&version=10.0.7
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—.resxdosyası tabanlı, yerel çeviriAmazonTranslateLocalizationManager— AWS Translate ile otomatik çeviriTranslateLocalizationManager— 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,IsActivealanlarıyla yetki grubu entity'siRoleGroupOperationClaim<TId, TRoleGroupId, TOperationClaimId>— grup ↔ claim N:N köprüsüUserRoleGroup<TId, TUserId, TRoleGroupId>— kullanıcı ↔ grup N:N köprüsü
ITokenHelperyeni overload —CreateToken(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,DeletedDatetimestamp'leriDateTime.UtcNow→DateTime.Nowolarak değiştirildi. ContainerTZortam 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 | Versions 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. |
-
net10.0
- AWSSDK.Translate (>= 4.0.1.23)
- FluentValidation (>= 12.1.1)
- FluentValidation.DependencyInjectionExtensions (>= 12.1.1)
- MailKit (>= 4.15.1)
- MediatR (>= 14.1.0)
- Microsoft.EntityFrameworkCore (>= 10.0.5)
- Microsoft.EntityFrameworkCore.InMemory (>= 10.0.5)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.5)
- Microsoft.IdentityModel.Tokens (>= 8.17.0)
- MimeKit (>= 4.15.1)
- NEST (>= 7.17.5)
- NEST.JsonNetSerializer (>= 7.17.5)
- Otp.NET (>= 1.4.1)
- Serilog (>= 4.3.1)
- Serilog.Sinks.File (>= 7.0.0)
- Swashbuckle.AspNetCore.SwaggerGen (>= 10.1.7)
- System.IdentityModel.Tokens.Jwt (>= 8.17.0)
- YamlDotNet (>= 16.3.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 |
|---|---|---|
| 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 |