Kista

June 19, 2026 · View on GitHub

GitHub release Nuget release GitHub license GitHub Workflow Status codecov Documentation

Kista logo

Kista

Renamed: This project was renamed from Deveel.Repository to Kista on May 26, 2025. The name Kista is Old Norse for "chest" or "repository", better reflecting the project's purpose as a data access framework.

Kista is a lightweight .NET framework that provides a principled implementation of the Repository Pattern, designed to help developers build applications grounded in Domain-Driven Design (DDD) and SOLID principles.

The framework abstracts data access behind a clean, stable interface — keeping your domain model independent of any specific persistence technology — while integrating seamlessly with popular data-access libraries as the underlying backing store.


Why Kista?

At its core, Kista is about keeping your domain clean.

In Domain-Driven Design the repository is not merely a data-access helper: it is the boundary between the domain model and the infrastructure layer. It speaks the language of the domain (entities, aggregates, identities) while hiding every detail of how data is fetched or persisted.

This library was born from the need to have a consistent, framework-agnostic abstraction for this boundary, without forcing application developers to:

  • couple their domain logic to a specific ORM or database driver, or
  • re-implement the same boilerplate repository scaffolding in every project.

It was never the intention to build another ORM. Object-Relational Mappers (and document-mapper equivalents) such as Entity Framework Core, Dapper, or MongoFramework are excellent tools for mapping objects to storage. Kista uses them — it does not replace them.

Kista vs. ORMs

The table below highlights the key differences and shows how both layers coexist:

ConcernORM (EF Core, Dapper, …)Kista
ResponsibilityMap objects ↔ database tables / documentsProvide a domain-oriented access interface
Speaks the language ofDatabase schema, SQL, driversDomain model (entities, aggregates)
Knows aboutTables, columns, change tracking, transactionsCollections of entities and their identities
Lives in layerInfrastructureDomain / Application boundary
Used byRepositories and infrastructure codeApplication services and domain services

In practice, you create a repository on top of an ORM — the ORM handles low-level persistence while Kista defines what the application can ask for. For example, Kista.EntityFramework wraps Entity Framework Core's DbContext behind the IRepository<TEntity> interface, giving the domain a stable contract that survives database migrations and EF Core upgrades. The same principle applies to Kista.MongoFramework (backed by MongoFramework / MongoDB) and any custom driver you care to write.

This is not a limitation — it is by design. Decoupling ORMs from domain logic is one of the most impactful architectural decisions you can make for long-term maintainability.


Libraries

The framework is organized into a kernel package (providing interfaces and abstractions) and a set of driver packages that wire those abstractions to concrete data sources.

  • Stable releases are published to NuGet.org.
  • Pre-release / unstable builds are available from the GitHub Packages feed (https://nuget.pkg.github.com/kista/index.json).
PackageDescriptionNuGet (stable)Pre-Release (GitHub)
KistaKernel abstractions: interfaces, base types, and DI extensionsNuGetGitHub
Kista.InMemoryVolatile, in-process repository — ideal for testing and prototypingNuGetGitHub
Kista.EntityFrameworkRepository driver backed by Entity Framework CoreNuGetGitHub
Kista.MongoFrameworkRepository driver backed by MongoFramework / MongoDBNuGetGitHub
Kista.MongoFramework.MultiTenantMulti-tenant MongoDB connection management via Finbuckle.MultiTenantNuGetGitHub
Kista.DynamicLinqFilter / query support via System.Linq.Dynamic.CoreNuGetGitHub
Kista.ManagerBusiness layer (EntityManager) with validation, normalization, event sourcing, and loggingNuGetGitHub
Kista.Manager.DynamicLinqDynamic LINQ query extensions for the Entity ManagerNuGetGitHub
Kista.Manager.EasyCachingSecond-level caching for the Entity Manager via EasyCachingNuGetGitHub
Kista.Manager.AspNetCoreASP.NET Core integration for automatic HTTP request cancellationNuGetGitHub
Kista.HealthChecksHealth check abstractions for repository connectivity monitoringNuGetGitHub
Kista.HealthChecks.EntityFrameworkEntity Framework Core health checksNuGetGitHub
Kista.HealthChecks.MongoFrameworkMongoDB health checksNuGetGitHub
Kista.HealthChecks.InMemoryIn-Memory health checksNuGetGitHub
Kista.Manager.AspNetCore.HealthChecksASP.NET Core endpoint integration for health checksNuGetGitHub
Kista.OwnersDecorator-based user scoping with automatic owner assignment and query filteringNuGetGitHub

Quick Start

1. Install a driver package

Pick the driver that matches your data source. The Core kernel package is pulled in automatically as a transitive dependency:

# Entity Framework Core
dotnet add package Kista.EntityFramework

# MongoDB
dotnet add package Kista.MongoFramework

# In-Memory (testing / prototyping)
dotnet add package Kista.InMemory

To consume an unstable pre-release build, add the GitHub Packages feed first:

dotnet nuget add source https://nuget.pkg.github.com/kista/index.json \
  --name kista-github --username <your-github-username> --password <your-pat>

2. Register the repository

Use the AddRepositoryContext() builder to configure your driver:

// Program.cs
builder.Services.AddRepositoryContext()
    .UseInMemory();

For Entity Framework Core or MongoDB, replace .UseInMemory() with the appropriate driver:

// Entity Framework Core
builder.Services.AddRepositoryContext()
    .UseEntityFramework<MyDbContext>();

// MongoDB
builder.Services.AddRepositoryContext()
    .UseMongoDB<MyMongoContext>();

After registration the following services are resolvable from the DI container (availability depends on the concrete repository's capabilities):

InterfaceDescription
IRepository<TEntity>Core CRUD, single-entity look-up (FindAsync), and unsorted pagination (GetPageAsync)
ITrackingRepository<TEntity>Change tracking and original value look-ups

Note: The legacy interfaces IQueryableRepository, IPageableRepository, and IFilterableRepository are deprecated. Query capabilities are now provided through protected members of Repository<TEntity, TKey>. For domain-specific queries, extend the base repository with custom methods. See the full documentation for details.

3. Consume the repository in your services

public class OrderService(IRepository<Order> orders)
{
    public Task<Order?> GetAsync(string id, CancellationToken ct)
        => orders.FindAsync(id, ct);

    public Task PlaceAsync(Order order, CancellationToken ct)
        => orders.AddAsync(order, ct);
}

4. Add Health Checks (Optional)

Monitor repository connectivity with built-in health checks:

// Install health check packages
dotnet add package Kista.HealthChecks
dotnet add package Kista.HealthChecks.EntityFramework  # or MongoFramework, InMemory

// Configure in Program.cs
builder.Services
    .AddRepositoryContext()
    .UseEntityFramework<MyDbContext>(ef => ef.WithHealthChecks());

builder.Services
    .AddHealthChecks()
    .AddKistaRepositories();

var app = builder.Build();
app.MapHealthChecks("/health");
app.Run();

For more details, see the Health Checks documentation.

For driver-specific configuration, multi-tenancy, and guidance on writing a custom repository, refer to the full documentation or browse it online at GitBook.


Documentation and Guides

TopicDescription
Getting StartedInstallation, requirements, and first steps
Entity Framework Core driverStoring entities via EF Core
MongoDB driverStoring entities in MongoDB
In-Memory driverIn-process volatile storage
Entity ManagerBusiness layer with validation, caching, and events
Custom repositoriesWrite your own driver
Multi-TenancyTenant-isolated repositories
User EntitiesUser-scoped entities with owner filtering
Health ChecksRepository connectivity monitoring

Full documentation is also available on GitBook.


Roadmap

We are actively building Kista toward a comprehensive, production-ready framework. See the complete roadmap for detailed feature descriptions, timelines, and architectural decisions.

Release Timeline

  • v1.5.0 — "Solid Ground"

    • Package Namespace Correction
    • Thread-Safe In-Memory Repository
    • Expression Compilation Cache
    • Full .NET 10 Compatibility and Benchmark Baseline
    • XML Documentation Completeness
    • Conversion to ValueTask Results for Asynchronous Methods
    • General Performance Optimizations
  • v1.6.0 — "Developer Flow"

    • Unified Repository Setup Builder
    • QueryBuilder Execution Extensions
    • Pluggable Cache Provider Abstraction
    • Automatic Timestamp and Ownership Management
    • Repository Health Checks
    • Repository Controller Lifecycle Redesign
  • v1.7.0 — "Entity Lifecycle"

    • Soft Delete Support
    • Entity State Machine
    • Domain Event Emission from EntityManager
  • v1.8.0 — "Scale & Throughput"

    • Batch Operations in EntityManager
    • Async Streaming Queries
    • Read/Write Repository Split
  • v1.9.0 — "Observability & Governance"

    • OpenTelemetry Integration
    • Audit Trail Support
    • EF Core Multi-Tenancy Parity
  • v2.0.0 — "Platform Modernization"

    • Minimum .NET 9 Baseline
    • Simplified Repository Interface Hierarchy
    • Remove Obsolete Capability Interfaces
    • Repository Source Generators
  • v2.1.0 — "New Database Drivers"

    • PostgreSQL Native Driver
    • Azure Cosmos DB Driver
    • Dapper Repository Driver
    • Service-Based Repository Driver
    • Neo4j Repository Driver

For more details on features, design rationale, and success criteria, see the ROADMAP.


License

The project is licensed under the terms of the Apache Public License v2, which allows unrestricted use in any project — open-source or commercial — without restriction.

Contributing

The project is open to contributions. Please read the contributing guidelines before opening a pull request.

Contributors

A huge thank-you to everyone who has contributed code, documentation, bug reports, and ideas:

Contributors

Contributions of all kinds are welcome — see CONTRIBUTING.md to get started.