anton-martyniuk/Modern
49.9
Weak · 21 September 2026
18k
lines of production code
C#
primary language
4
measurements over time
What this system is
This system is a modular .NET framework that provides a complete infrastructure for building data-driven applications, featuring a CQRS and repository pattern implementation with support for multiple data stores including EF Core, Dapper, MongoDB, and LiteDB. It includes a caching abstraction with in-memory and Redis implementations, along with generic Web API controllers that automatically register routes and dependency injection for CRUD and OData endpoints. The framework also offers source generators to reduce boilerplate and a service layer with optional caching, all targeting .NET 10.
How it got here
2022 — comprehensive architecture and infrastructure
21 changes.
This period focused on establishing the core architectural foundations of the Modern library, introducing generic abstractions for caching, repositories, and services. It also added concrete implementations for major data stores including EF Core, Dapper, MongoDB, and LiteDB, alongside a new ASP.NET Core host and automated controller registration.
2023 — Repository abstraction and DI integration
7 changes.
This period focused on unifying the data access layer by introducing asynchronous repositories, specification-based query composition, and standardized dependency injection registration across EF Core, MongoDB, and LiteDB. The work also introduced source generators to reduce boilerplate and added CQRS examples to demonstrate caching and custom handlers.
Features
Add CQRS controller examples with caching and custom handlers
Added new example projects demonstrating CQRS (Command Query Responsibility Segregation) patterns with cached data stores. The \Modern.Controllers.CQRS.DataStore.Cached.Examples\ project provides a standard implementation using EF Core and Redis caching, while \Modern.Controllers.CQRS.DataStore.Cached.Examples.Customized\ showcases a custom query handler for retrieving cities by country. Both examples include full setup of controllers, repositories, and dependency injection, illustrating how to integrate caching and CQRS in ASP.NET Core applications.
examples · high confidence
Add Dapper-based repository implementation with multi-database query generation
Introduced a new Dapper repository implementation that supports SQL Server, PostgreSQL, MySQL, SQLite, and Oracle via a pluggable \IQueryProvider\ architecture. The change adds connection factory abstractions, entity mapping classes, and DI registration extensions that allow users to register generic or concrete repositories with database-specific SQL generation for insert operations.
src/Repositories/Modern.Repositories.Dapper · high confidence
Add Modern.Application.Host ASP.NET Core host project
A new ASP.NET Core host project, Modern.Application.Host, has been added to the solution. This includes the entry point (Program.cs) which configures Swagger/OpenAPI for development, along with standard configuration files (appsettings.json, appsettings.Development.json) and launch settings. This provides the runtime environment for the application.
src/Host · high confidence
Add in-memory cache implementation with dependency injection support
Users can now register and use an in-memory cache implementation for entity caching. The change introduces a new \ModernInMemoryCache\ class that implements \IModernCache\ and supports standard memory cache options like absolute and sliding expiration times. It is registered via a new \AddInMemoryCache\ extension method that configures the service lifetime and cache settings through a fluent builder pattern.
src/Cache/Modern.Cache.InMemory · high confidence
Add in-memory controller registration and routing conventions
Introduces a new mechanism for registering and routing in-memory controllers via dependency injection. The change adds configuration models (ModernControllerSpecification, ModernControllerConcreteSpecification) and a ModernControllersOptions class to define controller metadata (request types, DTOs, routes). It includes a GenericTypeControllerFeatureProvider to auto-register controllers and a GenericControllerRouteConvention to apply API routes (defaulting to 'api/EntityDtoName' or a custom route). The ModernInMemoryController base class is updated to support this DI-driven registration, allowing developers to easily add in-memory controllers by specifying request types and DTOs in the DI container.
src/WebApi/Modern.Controllers.DataStore.InMemory · high confidence
Added async LiteDB repository with full DI integration and specification support
The \Modern.Repositories.LiteDB.Async\ package now provides an asynchronous repository implementation for LiteDB, including the \ModernLiteDbAsyncRepository\ class and a complete set of specification classes (\Specification\, \AndSpecification\, \OrSpecification\, and \LiteDbAsyncSpecification\) that enable complex query composition. Additionally, the package now supports dependency injection via the \AddRepositoriesLiteDbAsync\ extension method, allowing users to register repositories and concrete implementations directly through the \ModernServicesBuilder\.
src/Repositories/Modern.Repositories.LiteDB.Async · high confidence
Added in-memory OData controllers with automatic registration and routing
Users can now register in-memory OData controllers via a new \AddInMemoryODataControllers\ extension method. This feature automatically registers controllers in the dependency injection container and applies default URL routes (e.g., \api/odata/{EntityDtoName}\) through a custom route convention, simplifying the setup of generic OData endpoints.
src/WebApi/Modern.Controllers.DataStore.InMemory.OData · high confidence
Adds CQRS command and query abstractions with cached handlers
The CQRS layer now includes a full set of command and query abstractions (Create, Update, Delete, and various Get/Count/Exists/Where queries) alongside their corresponding cached implementations. These handlers integrate with a generic repository and a cache abstraction to manage data persistence and caching, providing a structured way to execute commands and retrieve data through MediatR.
src/CQRS · high confidence
Adds EF Core query provider and configuration for repository operations
Introduces new classes to support Entity Framework Core in the repository layer. This includes \EfCoreQueryProvider\ and \EfCoreQueryProviderWithFactory\ to handle database queries using either a direct \DbContext\ or a \IDbContextFactory\. The update also adds \EfCoreQueryable\ to wrap queryable operations and \IDbQueryProvider\ as the interface for query execution. Additionally, configuration classes \EfCoreRepositoryConfiguration\ and \EfCoreExecuteInTransactionConfiguration\ are added to manage transaction isolation levels and execution settings for create, update, and delete operations.
src/Repositories/Modern.Repositories.EFCore/Query · high confidence
EF Core repository implementation and unit of work support
The \Modern.Repositories.EFCore\ package now provides concrete implementations for Entity Framework Core, including \ModernEfCoreRepository\ for standard usage and \ModernEfCoreRepositoryWithFactory\ for scoped contexts, alongside a new \IModernUnitOfWork\ interface and \ModernUnitOfWork\ class to manage database transactions and save changes. This replaces the previous Dapper-based repository structure in this location, introducing full support for EF Core data access patterns.
src/Repositories/Modern.Repositories.EFCore · high confidence
EF Core specifications now support logical AND/OR composition and query application
The EF Core repository implementation now includes base classes for combining specifications with logical AND and OR operators, allowing users to compose complex filter, include, and order-by queries. The \Specification\ base class provides \And\ and \Or\ methods to combine specifications, while \EfCoreSpecification\ applies these combined expressions to \IQueryable\ results, supporting filtering, entity inclusion, and sorting.
src/Repositories/Modern.Repositories.EFCore/Specifications · high confidence
Introduce LiteDB repository implementation with DI and specification support
Added a new LiteDB repository implementation that includes a DI configuration via \AddRepositoriesLiteDb\ extension, allowing users to register repositories by specifying connection strings, collection names, and lifetimes. The update also brings in specification-based querying support, including \And\ and \Or\ logical combinations, along with expression visitors for filtering and ordering entities.
src/Repositories/Modern.Repositories.LiteDB · high confidence
Introduce MongoDB repository implementation
Adds the \ModernMongoDbRepository\ class and supporting documentation, providing a new concrete implementation of the repository pattern for MongoDB. This allows users to persist and query entities using MongoDB as a data store, with support for standard CRUD operations and bulk updates via the \Modern.Repositories.MongoDB\ package.
src/Repositories/Modern.Repositories.MongoDB · high confidence
Introduce Redis cache implementation with dependency injection support
Added a new Redis-based cache implementation that integrates with the existing cache abstractions. The change introduces configuration models (ModernRedisCacheSettings, ModernCacheSpecification) and a DI extension (AddRedisCache) that registers the cache services. The implementation supports generic entity types, configurable expiration times, and standard CRUD operations (get, add/update, delete) via the IModernCache interface.
src/Cache/Modern.Cache.Redis · high confidence
Introduce generic CQRS controllers with automatic DI and routing
Adds a new \ModernCqrsController\ base class that provides standard CRUD endpoints (GetById, GetAll, Create, Update, Patch) backed by MediatR. The change introduces a DI registration extension (\AddCqrsControllers\) that accepts a \ModernControllersOptions\ configuration to map request types, DTOs, and API routes. A custom \IControllerModelConvention\ and \IApplicationFeatureProvider\ automatically register these controllers and apply default URL routes (e.g., \api/{EntityDtoName}\), simplifying the setup of generic CQRS controllers in the WebApi layer.
src/WebApi/Modern.Controllers.CQRS.DataStore · high confidence
Introduce generic ModernController with automatic DI registration and route conventions
Adds a new \ModernController\ base class that provides standard CRUD endpoints (GetById, GetAll, Create, Update, Patch) for entity services. The change introduces a declarative registration API (\ModernControllersOptions\) that allows developers to specify request types, DTOs, and entity types. This configuration drives a new \IApplicationFeatureProvider\ and \IControllerModelConvention\ that automatically register the corresponding controller types and apply default API routes (e.g., \api/{EntityDtoName}\) or custom routes specified in the options. This simplifies the setup of generic REST controllers by removing the need for manual DI registration and route configuration for each entity.
src/WebApi/Modern.Controllers.DataStore · high confidence
Introduce generic OData controller with automatic DI registration and route conventions
Added a new generic OData controller (\ModernODataController\) that operates directly on repositories rather than services, allowing for more efficient data access. The update includes a new dependency injection registration system (\AddODataControllers\) that automatically registers controllers and applies default URL routes (e.g., \api/odata/\[controller\]\). This feature is supported by new configuration models (\ModernControllerSpecification\, \ModernControllerConcreteSpecification\) and ASP.NET Core conventions (\GenericControllerRouteConvention\, \GenericTypeControllerFeatureProvider\) that handle the wiring and routing for these controllers.
src/WebApi/Modern.Controllers.DataStore.OData · high confidence
Introduces the IModernCache interface for cache operations
A new IModernCache interface is added to the Modern.Cache.Abstractions package, defining the contract for cache operations. It specifies methods for adding or updating entities (single and batch), deleting entities (single and batch), and retrieving entities by ID or list of IDs. All methods now return ValueTask, indicating an asynchronous, high-performance API for cache interactions.
src/Cache/Modern.Cache.Abstractions · high confidence
Modern.sln solution file added
The solution file Modern.sln has been added to the src directory, defining the build configuration and project references for the entire Modern repository, including repositories, services, controllers, and source generators.
src · high confidence
New DI registration API for EF Core repositories
The \Modern.Repositories.EFCore\ library now provides a dedicated extension method, \AddRepositoriesEfCore\, to register repository implementations via dependency injection. This new API allows developers to configure repositories using three distinct patterns: standard DbContext sharing, per-method DbContextFactory usage, and UnitOfWork-based sharing. The registration is configured through a \ModernEfCoreRepositoriesOptions\ builder, which supports both generic repository interfaces and concrete implementations, simplifying the setup of data access layers.
src/Repositories/Modern.Repositories.EFCore/DI · high confidence
New exception types and DI builder for common utilities
Added new exception classes (EntityAlreadyExistsException, EntityConcurrentUpdateException, EntityNotFoundException, EntityNotModifiedException, InternalErrorException, RepositoryErrorException) to the Modern.Exceptions library, providing specific error handling for data operations. Additionally, introduced a ModernServicesBuilder and corresponding extension methods in Modern.Extensions.Microsoft.DependencyInjection to simplify service registration via a fluent API.
src/Common · high confidence
New generic service abstractions and cached/in-memory implementations
The \src/Services\ area introduces new generic service interfaces (\IModernCrudService\, \IModernQueryService\, \IModernService\) and their corresponding implementations (\ModernCachedService\, \ModernInMemoryService\) that provide CRUD and query capabilities with optional caching. The cached service respects the \AddOrUpdateInCacheWhenEntityIsUpdated\ configuration option to control cache invalidation on updates, and the in-memory service provides a full in-memory data store implementation. These services are registered via the \AddCachedServices\ and \AddInMemoryServices\ extension methods in the dependency injection container.
src/Services · high confidence
New repository abstraction interfaces for CRUD and query operations
The Modern.Repositories.Abstractions package now provides a unified repository contract, introducing IModernCrudRepository for create, update, and delete operations, and IModernQueryRepository for data retrieval including filtering, paging, and eager loading via EntityIncludeQuery. The combined IModernRepository interface aggregates both capabilities, and the ISpecification interface enables declarative query composition.
src/Repositories/Modern.Repositories.Abstractions · high confidence
Source generators for controllers, repositories, and services
Added source generators that automatically generate controller, repository, and service implementations for entities. This includes attributes like ModernControllerAttribute, ModernEfCoreRepositoryAttribute, and ModernServiceAttribute, which enable code generation for Web API controllers, data access layers (EF Core, Dapper, MongoDB, LiteDB), and business services, reducing boilerplate code.
src/SourceGenerators · high confidence
Behavioural changes
MongoDB repository now supports logical AND/OR specification composition
The MongoDB repository implementation now includes new base classes (AndSpecification, OrSpecification, Specification) and a ReplaceExpressionVisitor to handle expression tree manipulation. This allows users to combine multiple filter, include, and order-by conditions using logical AND/OR operations, enabling more complex query composition in MongoDB repositories.
src/Repositories/Modern.Repositories.MongoDB/Specifications · high confidence
New DI registration API for MongoDB repositories
The MongoDB repository layer now provides a dedicated dependency injection setup via the new \ModernMongoDbRepositoriesOptions\ configuration class and \ServicesExtensions.AddRepositoriesMongoDb\ extension method. Users can now configure MongoDB client settings and register generic or concrete repository implementations directly through the modern services builder, replacing the previous approach where DI features were handled separately.
src/Repositories/Modern.Repositories.MongoDB/DI · high confidence
Test coverage
Added initial test scaffolding for integration and unit test projects
New Usings.cs files were added to multiple integration and unit test projects, establishing the baseline test environment. Most test projects now include global usings for xUnit, while specific unit test projects additionally include global usings for Moq and FluentAssertions, preparing these test suites for future test cases.
tests · high confidence
Dependencies
Modern .NET libraries now support .NET 10.0
All Modern libraries and example projects have been updated to target .NET 10.0, with many packages now supporting both .NET 8.0 and .NET 10.0. This update aligns the Modern ecosystem with the latest .NET runtime, ensuring compatibility with the newest framework features and performance improvements.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 50 → 50 (+0.2)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 91 → 90 (-1.5)
- Architecture 82 → 82 (+0.0)
- Maturity 49 → 49 (+0.0)
- Readiness 31 → 32 (+1.1)
- Security 89 → 83 (-5.7)
- Performance 76 → 76 (+0.0)
Resolved (67)
- Bounded contexts not declared
- Duplicated block (10 lines × 2) (src/Repositories/Modern.Repositories.EFCore/Query/EfCoreQueryProvider.cs)
- Duplicated block (10 lines × 2) (src/Repositories/Modern.Repositories.EFCore/Query/EfCoreQueryProvider.cs)
- Duplicated block (10 lines × 2) (src/SourceGenerators/Modern.Controllers.SourceGenerators/EntityRequestGenerator.cs)
- Duplicated block (10 lines × 2) (src/SourceGenerators/Modern.Controllers.SourceGenerators/ModernControllerGenerator.cs)
- Duplicated block (11 lines × 2) (src/CQRS/Modern.CQRS.DataStore/QueryHandlers/GetFirstOrDefaultQueryHandler.cs)
- Duplicated block (11 lines × 2) (src/CQRS/Modern.CQRS.DataStore/QueryHandlers/GetSingleOrDefaultQueryHandler.cs)
- Duplicated block (11 lines × 2) (src/CQRS/Modern.CQRS.DataStore/QueryHandlers/GetWhereQueryHandler.cs)
- Duplicated block (11 lines × 2) (src/Repositories/Modern.Repositories.EFCore/Query/EfCoreQueryProvider.cs)
- Duplicated block (11 lines × 2) (src/Repositories/Modern.Repositories.EFCore/Query/EfCoreQueryProvider.cs)
- Duplicated block (11 lines × 2) (src/Repositories/Modern.Repositories.EFCore/Specifications/EfCoreSpecification.cs)
- Duplicated block (11 lines × 3) (src/Repositories/Modern.Repositories.EFCore/ModernEfCoreRepository.cs)
- Duplicated block (12 lines × 2) (src/CQRS/Modern.CQRS.DataStore/QueryHandlers/GetAllQueryHandler.cs)
- Duplicated block (12 lines × 2) (src/Services/Modern.Services.DataStore/DI/ServicesExtensions.cs)
- Duplicated block (13 lines × 2) (src/CQRS/Modern.CQRS.DataStore/QueryHandlers/GetCountAllQueryHandler.cs)
- Duplicated block (13 lines × 2) (src/CQRS/Modern.CQRS.DataStore/QueryHandlers/GetCountQueryHandler.cs)
- Duplicated block (13 lines × 2) (src/CQRS/Modern.CQRS.DataStore/QueryHandlers/GetExistsQueryHandler.cs)
- Duplicated block (13 lines × 2) (src/Repositories/Modern.Repositories.LiteDB.Async/ModernLiteDbAsyncRepository.cs)
- Duplicated block (13 lines × 2) (src/Services/Modern.Services.DataStore/ModernService.cs)
- Duplicated block (13 lines × 2) (src/Services/Modern.Services.DataStore/ModernService.cs)
- …and 47 more
New (221)
- Documentation: no installation or build instructions (README.md)
- Duplicated block (10 lines × 2) (src/Repositories/Modern.Repositories.EFCore/ModernEfCoreRepository.cs)
- Duplicated block (10 lines × 2) (src/Repositories/Modern.Repositories.EFCore/ModernEfCoreRepository.cs)
- Duplicated block (10 lines × 2) (src/Repositories/Modern.Repositories.EFCore/Query/EfCoreQueryProvider.cs)
- Duplicated block (10 lines × 2) (src/Repositories/Modern.Repositories.EFCore/Query/EfCoreQueryProvider.cs)
- Duplicated block (10 lines × 2) (src/Repositories/Modern.Repositories.EFCore/Query/EfCoreQueryProvider.cs)
- Duplicated block (10 lines × 2) (src/WebApi/Modern.Controllers.DataStore.InMemory/ModernInMemoryController.cs)
- Duplicated block (10 lines × 2) (src/WebApi/Modern.Controllers.DataStore.InMemory/ModernInMemoryController.cs)
- Duplicated block (10 lines × 3) (src/CQRS/Modern.CQRS.DataStore.Cached/CommandHandlers/CreateEntitiesCommandHandler.cs)
- Duplicated block (11 lines × 10) (src/CQRS/Modern.CQRS.DataStore.Cached/QueryHandlers/GetCountQueryHandler.cs)
- Duplicated block (11 lines × 2) (src/Repositories/Modern.Repositories.EFCore/ModernEfCoreRepository.cs)
- Duplicated block (11 lines × 2) (src/Repositories/Modern.Repositories.EFCore/ModernEfCoreRepositoryWithFactory.cs)
- Duplicated block (11 lines × 2) (src/Services/Modern.Services.DataStore.Cached/ModernCachedService.cs)
- Duplicated block (11 lines × 2) (src/SourceGenerators/Modern.Controllers.InMemory.SourceGenerators/ModernInMemoryControllerGenerator.cs)
- Duplicated block (11 lines × 2) (src/SourceGenerators/Modern.Repositories.LiteDB.Async.SourceGenerators/ModernLiteDbAsyncRepositoryGenerator.cs)
- Duplicated block (11 lines × 2) (src/WebApi/Modern.Controllers.DataStore.InMemory/ModernInMemoryController.cs)
- Duplicated block (11 lines × 3) (src/Services/Modern.Services.DataStore.Cached/ModernCachedService.cs)
- Duplicated block (11 lines × 4) (src/CQRS/Modern.CQRS.DataStore.Cached/QueryHandlers/GetByIdQueryHandler.cs)
- Duplicated block (11 lines × 4) (src/Repositories/Modern.Repositories.EFCore/Specifications/Base/Specification.cs)
- Duplicated block (11–16 lines × 2) (src/Cache/Modern.Cache.Redis/ModernRedisCache.cs)
- …and 201 more
API surface
- Unchanged — 31 HTTP endpoints
Architecture
- Unchanged — 3 containers · 0 contexts · 0 edges
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
anton-martyniuk/Modern was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit cbb57f71084c995870c9d51c17ca58e1171f8ed2 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-28e75b8e3254.