Kck.Core.Abstractions
5.0.0
dotnet add package Kck.Core.Abstractions --version 5.0.0
NuGet\Install-Package Kck.Core.Abstractions -Version 5.0.0
<PackageReference Include="Kck.Core.Abstractions" Version="5.0.0" />
<PackageVersion Include="Kck.Core.Abstractions" Version="5.0.0" />
<PackageReference Include="Kck.Core.Abstractions" />
paket add Kck.Core.Abstractions --version 5.0.0
#r "nuget: Kck.Core.Abstractions, 5.0.0"
#:package Kck.Core.Abstractions@5.0.0
#addin nuget:?package=Kck.Core.Abstractions&version=5.0.0
#tool nuget:?package=Kck.Core.Abstractions&version=5.0.0
Kck.Core.Abstractions
Core domain primitives — Entity<TId> / AuditableEntity<TId> / FullEntity<TId> hierarchy, Result<T> / Error pattern, and Paginate<T> pagination.
Installation
dotnet add package Kck.Core.Abstractions
Quick Start
using Kck.Core.Abstractions.Entities;
using Kck.Core.Abstractions.Paging;
using Kck.Core.Abstractions.Results;
// 1. Define a domain entity that raises a domain event
public class Order : FullEntity<Guid>
{
public string CustomerName { get; private set; } = string.Empty;
public decimal Total { get; private set; }
public static Order Create(string customerName, decimal total)
{
var order = new Order { Id = Guid.CreateVersion7(), CustomerName = customerName, Total = total };
order.AddDomainEvent(new OrderCreated(order.Id));
return order;
}
}
public sealed record OrderCreated(Guid OrderId) : IDomainEvent
{
public Guid EventId { get; } = Guid.CreateVersion7();
public DateTime OccurredOn { get; } = DateTime.UtcNow;
}
public class OrderFactory
{
// 2. Return a Result instead of throwing for expected failures
public Result<Order> Create(string customerName, decimal total) =>
total <= 0
? Result<Order>.Failure(new Error("order.total", "Total must be positive.", ErrorType.Validation))
: Result<Order>.Success(Order.Create(customerName, total));
// 3. Build a page from data you already loaded (repositories return IPaginate<T> for you)
public IPaginate<Order> FirstPage(IReadOnlyList<Order> items, int totalCount) =>
Paginate<Order>.Create(items, totalCount, index: 0, size: 20);
}
Configuration
This is a contracts-only package — no configuration required. Used as a transitive dependency by provider and bundle packages.
Resources
| 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
- Kck.Pipeline.Abstractions (>= 5.0.0)
NuGet packages (7)
Showing the top 5 NuGet packages that depend on Kck.Core.Abstractions:
| Package | Downloads |
|---|---|
|
Kck.Security.Abstractions
Provider-agnostic security contracts. Defines IHashingService (password hashing), ITokenService (JWT), ITokenBlacklistService, ISecretsManager, and IMfaProvider. Implement with Argon2, JWT, and Key Vault providers. |
|
|
Kck.Persistence.Abstractions
Provider-agnostic persistence contracts following Repository and Unit of Work patterns. Defines IReadRepository<T,TId>, IWriteRepository<T,TId>, IUnitOfWork, dynamic filtering, and Specification pattern. Implement with the Entity Framework Core provider. |
|
|
Kck.Pipeline.Mediator
Mediator.Abstractions 3.x-backed pipeline behaviors for Kck. Provides Authorization, Caching, Logging, Transaction, and Validation cross-cutting behaviors. The recommended pipeline provider since Kck v2. Registered via AddKckMediator(). |
|
|
Kck.Persistence.EntityFramework
Entity Framework Core implementations of IReadRepository<T,TId>, IWriteRepository<T,TId>, and IUnitOfWork. Includes AuditInterceptor (auto CreatedDate/ModifiedDate), DynamicFilterExtensions, soft-delete support, and ToPaginateAsync extension. Registered via AddKckEntityFramework<TContext>(). |
|
|
Kck.Bundle.MinimalApi
Lightweight ASP.NET Core Minimal API starter pack. Slim variant of the WebAPI bundle — provides Serilog, in-memory caching, the JWT token service, exception handling, and health checks, without Argon2, the event bus or rate limiting. |
GitHub repositories
This package is not used by any popular GitHub repositories.