AlphaYu/adnc
50.9
Adequate · 21 September 2026
27.1k
lines of production code
C#
primary language
4
measurements over time
What this system is
This system is a modular .NET 8.0 microservices framework that provides a complete infrastructure layer for building distributed applications. It offers standardized implementations for data access (EF Core, Dapper, MongoDB), caching (Redis), service discovery (Consul), and event-driven communication (CAP/RabbitMQ). The framework also includes shared Web API components for authentication, authorization, and logging, enabling developers to rapidly assemble scalable, loosely-coupled services.
How it got here
2020–2025 — infrastructure and shared service consolidation
115 changes.
This period focused on establishing a robust, unified infrastructure layer by introducing comprehensive support for Redis caching, MongoDB, and multiple database providers (MySQL, SQL Server, Dapper) with consistent repository patterns. The work also standardized the shared application and web API layers by implementing modular dependency injection, flexible authentication mechanisms, and centralized configuration management via Consul.
2026 — Demo service expansion and infrastructure setup
13 changes.
This period focused on implementing full CRUD and management capabilities for multiple demo domains, including Admin, Customer, Maintenance, Order, and Warehouse services. The work involved building out the complete application, repository, and API layers for these features, alongside establishing the initial database schema and staging infrastructure for monitoring and configuration.
Features
Add .gitignore, CNAME, and English/Chinese README documentation
The repository now includes a \.gitignore\ file to exclude build artifacts, IDE settings, and local environment files from version control. A \CNAME\ file is added to configure the GitHub Pages domain \docs.aspdotnetcore.net\. Additionally, the project documentation is expanded with a comprehensive English \README.md\ and a new \README\_ZH.md\ (Chinese) file, both detailing the ADNC framework's architecture, technology stack, and getting started guide.
(repo-wide) · high confidence
Add Consul configuration support with JSON parsing and hot-reload
A new Consul configuration system has been introduced, allowing the application to load and dynamically reload configuration data from a Consul key-value store. This includes a \ConsulOptions\ class for settings, a \DefaultConsulConfigurationProvider\ that fetches data from Consul and supports hot-reloading when the underlying JSON content changes, and a custom \JsonConfigurationFileParser\ to parse the JSON payload. This enables runtime updates to configuration without restarting the service.
src/Infrastructures/Consul/Configuration · high confidence
Add Consul integration extensions for configuration, service registration, and dependency injection
New extension methods are introduced in the Consul infrastructure layer to enable seamless integration with HashiCorp Consul. The \ConfigurationBuilderExtension\ adds Consul as a configuration source, allowing the application to load settings from Consul keys. The \HostExtension\ provides methods to register the current service with Consul, supporting automatic discovery via Kestrel endpoint configuration or manual address registration. Additionally, the \ServiceCollectionExtension\ registers the Consul client and related options in the DI container, supporting both singleton and scoped lifetimes. These changes allow developers to easily integrate Consul for service discovery and configuration management.
src/Infrastructures/Consul/Extensions · high confidence
Add Consul service discovery HTTP handler
A new \ConsulDiscoverDelegatingHandler\ class has been added to the \src/Infrastructures/Consul/Discover/Handler\ directory. This HTTP delegating handler intercepts outgoing requests to resolve service addresses via Consul, applying a random load balancer and caching strategy before forwarding the request. The implementation ensures the original request URI is restored in a finally block, and logs debug information about the resolved service address.
src/Infrastructures/Consul/Discover/Handler · high confidence
Add Consul service discovery provider
Introduces a new service discovery mechanism for Consul, providing an IDiscoverProvider interface and a DiscoverProvider implementation that caches service health status in memory and supports load balancing. The feature includes a DiscoverProviderBuilder for configuring the provider with service name, cache duration, logger, and load balancer.
src/Infrastructures/Consul/Discover · high confidence
Add Consul-based gRPC service discovery resolver
A new ConsulGrpcResolver implementation has been added to enable gRPC load balancing via Consul service discovery. This change introduces a PollingResolver that queries Consul for healthy service instances, dynamically updating the list of available gRPC endpoints. Additionally, a corresponding factory (ConsulGrpcResolverFactory) is provided to register this resolver with the 'consul' scheme, allowing the application to discover and route traffic to backend services registered in Consul.
src/Infrastructures/Consul/Discover/GrpcResolver · high confidence
Add Dapper repository service registration with configurable lifetime
The Dapper infrastructure now exposes a new \AddAdncInfraDapper\ extension method that registers the Dapper-based repository interfaces (\IAdoExecuterRepository\, \IAdoExecuterWithQuerierRepository\, \IAdoQuerierRepository\) with the DI container. A key change is that the service lifetime is now configurable (defaulting to Scoped), allowing consumers to control the lifecycle of these repository services. Additionally, a \ConfigurationExtension\ helper was added to safely retrieve database connection strings and types from configuration.
src/Infrastructures/Repository.Dapper/Extensions · medium confidence
Add HTTP client interfaces and message types for remote services
The demo application now includes new HTTP client interfaces and message types for interacting with remote services. Specifically, IAdminRestClient exposes endpoints for dictionary options and system configuration, while IWhseRestClient provides a method to retrieve product lists. These are supported by new message classes (DictOptionResponse, SysConfigSimpleResponse, ProductResponse, ProductSearchRequest) and service address constants, enabling the application to communicate with the admin, warehouse, and other microservices via HTTP.
src/Demo/Shared/Remote.Http · medium confidence
Add JWT token validation helper for Ocelot gateway
A new static extension class, JwtSecurityTokenHandlerExtension, has been added to the Ocelot identity gateway. It provides a method to generate TokenValidationParameters for JWT authentication, mapping configuration options such as issuer, audience, signing key, and clock skew. This simplifies the setup of JWT validation within the gateway layer.
src/Gateways/Ocelot/Identity · high confidence
Add MySQL EF Core service registration extension
A new \ServiceCollectionExtension\ class was added to register MySQL Entity Framework Core services, including the \DbContext\, \IUnitOfWork\, and related repository components, with support for assembly scanning and configurable service lifetimes.
src/Infrastructures/Repository.EfCore.Mysql/Extensions · high confidence
Add RSA key serialization and deserialization extensions
The \EncryptExtensions\ and \RsaKeyExtensions\ classes have been added to the encryption helper infrastructure. \RsaKeyExtensions\ introduces extension methods for the \RSA\ class, enabling serialization of RSA keys to and from JSON and XML formats. This allows for easier storage and transmission of RSA key parameters, with specific handling for both public and private key components in the JSON output and robust parsing of XML structures.
src/Infrastructures/Helper/Internal/Encrypt/Extensions · high confidence
Add Redis caching diagnostic event data classes and listener extensions
Added new classes in the \src/Infrastructures/Redis.Caching/Core/Diagnostics\ directory to support Redis caching diagnostics. This includes \EventData\ and specific event data classes (\BeforeExistsRequestEventData\, \BeforeGetRequestEventData\, \BeforePublishMessageRequestEventData\, \BeforeRemoveRequestEventData\, \BeforeSetRequestEventData\, \BeforeSubscribeMessageRequestEventData\) that carry context for cache operations. Additionally, \DiagnosticDataWrapper\ and \CachingDiagnosticListenerExtensions\ were introduced to handle diagnostic data wrapping and expose extension methods on \DiagnosticListener\ for logging before/after/error states of cache operations.
src/Infrastructures/Redis.Caching/Core/Diagnostics · high confidence
Add SQL Server EF Core service registration extension
Users can now register SQL Server Entity Framework Core repositories and unit of work services via a single extension method, which configures the DbContext, UoW interceptor, and repository services with scoped lifetime.
src/Infrastructures/Repository.EfCore.SqlServer/Extensions · high confidence
Add Unit of Work interceptors for transaction management
The repository layer now includes a new set of interceptors to handle database transactions automatically. A new \UnitOfWorkAttribute\ allows marking methods for transactional behavior, with support for distributed transactions via a \Distributed\ flag. The \UowAsyncInterceptor\ and \UowInterceptor\ classes implement \Castle.DynamicProxy\'s \IAsyncInterceptor\ and \IInterceptor\ interfaces respectively, wrapping method invocations to begin, commit, or roll back a unit of work. This enables declarative transaction management for repository methods without manual transaction handling in the business logic.
src/Infrastructures/Repository/Interceptor · high confidence
Add Yitter-based distributed ID generator with Redis-backed worker node management
A new ID generation infrastructure has been introduced in the Yitter module, providing a distributed, high-throughput ID generator. The static IdGenerater class exposes methods to initialize a worker ID, generate single or batch IDs, and create prefixed string IDs. To support distributed environments, a WorkerNode class manages worker state in Redis, using a Lua script to atomically retrieve and update worker IDs. A background hosted service initializes the worker nodes on startup, sets the current worker ID, and periodically refreshes the worker's score in Redis to ensure availability. This change adds the capability to generate unique, time-ordered IDs across multiple service instances.
src/Infrastructures/IdGenerater/Yitter · high confidence
Add abstract cache provider and default Redis caching implementation
The \src/Infrastructures/Redis.Caching/Provider\ directory now contains the core caching logic, introducing an \AbstracCacheProvider\ base class and a \DefaultCachingProvider\ implementation. This adds support for Redis-based caching with features including cache hit/miss logging, distributed locking to prevent cache penetration, and optional Bloom filter integration to mitigate cache penetration attacks.
src/Infrastructures/Redis.Caching/Provider · high confidence
Add centralized Redis caching service registration with SkyAPM tracing support
A new \ServiceCollectionExtension\ class has been introduced to centralize the registration of Redis caching infrastructure services. This extension method configures the cache provider, key generator, and interceptors, while also supporting optional preheating and Bloom filter implementations. Additionally, it integrates SkyAPM distributed tracing by conditionally registering a \CacheTracingDiagnosticProcessor\ when SkyAPM is detected in the environment.
src/Infrastructures/Redis.Caching/Extensions · high confidence
Add configuration options for Redis caching behavior
A new CacheOptions class has been introduced to centralize configuration for the Redis caching infrastructure. This includes settings for jitter (MaxRdSecond), logging, mutex sleep and lock durations (SleepMs, LockMs), and specific configurations for cache penetration protection (PenetrationOptions) including Bloom filter parameters. These options allow users to tune caching performance, resilience, and security features.
src/Infrastructures/Redis.Caching/Configurations · medium confidence
Add custom exception filter for standardized error responses
A new \CustomExceptionFilterAttribute\ has been added to the WebApi filters. It intercepts unhandled exceptions and returns a standardized \ProblemDetails\ response. For known \IAdncException\ types, it returns the specific status code and message; for all other exceptions, it returns a generic system error message in production (while exposing details in development) and logs the error with a request ID and URL.
src/ServiceShared/WebApi/Filters · high confidence
Add custom exception handling and real IP resolution middleware
Two new middleware components are introduced to the web API pipeline. The CustomExceptionHandlerMiddleware intercepts unhandled exceptions and returns structured JSON error responses; it also enforces a demo-environment restriction that blocks POST, PUT, DELETE, and PATCH requests unless the DEMO\_SERVER environment variable is set to a truthy value, with specific paths like /auth/session and /profiler/results allowed. The RealIpMiddleware extracts the client's real IP address from a configurable request header and updates the connection's RemoteIpAddress. Both middlewares are registered via extension methods (UseCustomExceptionHandler and UseRealIp).
src/ServiceShared/WebApi/Middleware · high confidence
Add database schema and staging infrastructure for the adnc application
This change introduces the initial database schema for the \adnc\_admin\ MySQL database, including tables for system configuration (\sys\_config\), dictionaries (\sys\_dictionary\, \sys\_dictionary\_data\), menus (\sys\_menu\), organizations (\sys\_organization\), and event tracking (\sys\_eventtracker\), along with initial seed data for menus and dictionaries. Additionally, it adds staging deployment configurations: a Consul cluster setup (three servers and one client) with a bootstrap script and KV store JSON for application settings, and a Loki/Grafana stack for log aggregation and monitoring.
database, deploy · high confidence
Add default serialization implementations for Redis cache
Added the ISerializer interface and three default implementations: DefaultBinarySerializer (using BinaryFormatter), DefaultJsonSerializer (using System.Text.Json), and DefaultProtobufSerializer (using ProtoBuf). These provide out-of-the-box support for binary, JSON, and Protobuf serialization strategies within the Redis infrastructure.
src/Infrastructures/Redis/Core/Serialization · high confidence
Add development environment configuration and Swagger UI resources
A new \appsettings.shared.Development.json\ file is introduced, providing configuration for Redis, RabbitMQ, MySQL, Consul, RPC endpoints, logging, and JWT authentication for the development environment. Additionally, \swagger\_miniprofiler.html\ is added to support Swagger UI with MiniProfiler integration, enabling developers to view performance metrics and interact with the API documentation locally.
src/Demo/Shared/resources · high confidence
Add distributed transaction support for MySQL and SQL Server repositories
New MySQL and SQL Server unit-of-work implementations now support distributed transactions via the ICapPublisher interface. When a transaction is marked as distributed, the system attempts to use the publisher for transaction management; if the publisher is not provided, an exception is thrown. This enables cross-database or cross-service transactional consistency for these specific database providers.
src/Infrastructures/Repository.EfCore.Mysql/Transaction, src/Infrastructures/Repository.EfCore.SqlServer/Transaction · medium confidence
Add event base classes and message tracking interfaces
The EventBus infrastructure now includes foundational types for event handling and idempotency. New classes \BaseEvent\ and \EventEntity\<TData\>\ provide a standard structure for events, including metadata like ID, source, and occurrence time. Additionally, the \IEventPublisher\ interface has been expanded with methods for delayed message publishing (\PublishDelay\/\PublishDelayAsync\) and custom headers. To support event tracking and deduplication, the \IMessageTracker\ interface and \TrackerKind\ enum have been introduced, allowing implementations to track processed events across different storage backends.
src/Infrastructures/EventBus · high confidence
Add internal encryption utilities for AES, DES, Base64, MD5, SHA, and RSA
The \src/Infrastructures/Helper/Internal/Encrypt\ directory now contains a new \EncryptProvider\ class that implements internal cryptographic helpers. This includes AES encryption/decryption (with and without IV), DES encryption/decryption (ECB/CBC modes), Base64 encode/decode, MD5 and MD5-HMAC hashing, SHA1/256/384/512 hashing, HMAC-SHA variants, and RSA key generation, PEM/PEM conversion, and signing/verification. These utilities are marked as internal and are intended for use within the infrastructure layer.
src/Infrastructures/Helper/Internal/Encrypt · high confidence
Add modular NLog configuration files for console, file, and Loki log targets
The application now ships with four distinct NLog configuration files (nlog-all.config, nlog-console.config, nlog-file.config, and nlog-loki.config) in the shared resources directory. These configurations enable flexible logging strategies: developers can choose between console output, file-based storage, or sending logs to a Loki endpoint, each with specific formatting and routing rules for Adnc, Microsoft, and default loggers.
src/Demo/Shared/resources/NLog · high confidence
Add order management API and domain model
The demo application now includes a complete order management feature. This introduces an Order API with endpoints for creating, paying, canceling, deleting, and retrieving orders. The domain model includes Order, OrderItem, and related value objects, along with domain services that publish events for inventory reservation and payment processing. Entity configurations and database migrations are provided to persist order data.
src/Demo/Ord/Api · high confidence
Add shared validation extensions and assembly resolution utilities
The application layer now includes new shared utilities for validation and assembly management. FluentValidation extensions have been added to provide convenient, reusable validation rules for common data formats such as phone numbers, emails, URLs, and Chinese characters. Additionally, a new DependencyAssemblyInfo class has been introduced to dynamically resolve application, contract, repository, and domain assemblies, simplifying dependency injection and reflection-based operations.
src/ServiceShared/Application · high confidence
Added Basic Authentication Handler
Introduced a new Basic authentication handler for the WebApi layer. The change adds \BasicAuthenticationHandler\ which parses the Authorization header, validates tokens via \BasicTokenValidator\, and issues a \ClaimsIdentity\ with NameId, UniqueName, and Name claims upon success. Supporting types include \BasicDefaults\ for scheme constants, \BasicEvents\ for token validation hooks, \BasicSchemeOptions\ for configuration, \BasicPostConfigureOptions\ for setup, and \BasicTokenValidatedContext\ for event context.
src/ServiceShared/WebApi/Authentication/Basic · high confidence
Added Bearer authentication and JWT token generation components
The Bearer authentication handler and supporting classes have been added to the WebApi service, introducing a new mechanism for validating Bearer tokens and generating JWT access and refresh tokens. This includes the \BearerAuthenticationHandler\ for request validation, \JWTOptions\ for configuration, and \JwtTokenHelper\ for token creation, enabling the system to authenticate users via Bearer tokens and issue signed JWTs.
src/ServiceShared/WebApi/Authentication/Bearer · high confidence
Added Castle DynamicProxy interceptors for Redis caching
Introduced new C\# classes—CachingAsyncInterceptor, CachingInterceptor, and TypeExtensions—within the Redis caching infrastructure. These components implement Castle DynamicProxy interceptors that automatically handle caching logic for synchronous and asynchronous methods, supporting cache retrieval, storage, and eviction based on defined attributes.
src/Infrastructures/Redis.Caching/Core/Interceptor/Castle · high confidence
Added Consul service registration and IP resolution utilities
New KestrelOptions and RegistrationProvider classes have been added to the Consul infrastructure. The RegistrationProvider enables services to register with Consul on application start and deregister on shutdown, while also providing methods to retrieve local server IP addresses. This introduces the core mechanism for service discovery and health checking within the Consul registry.
src/Infrastructures/Consul/Registrar · high confidence
Added HTTP client handlers for caching and token management
Introduced two new HTTP client handlers in the shared service layer. CacheDelegatingHandler provides a placeholder for GET request caching logic (currently disabled), while TokenDelegatingHandler automatically upgrades HTTPS requests to HTTP/2 and injects authorization tokens via a factory pattern.
src/ServiceShared/Remote/Handlers · high confidence
Added Hybrid authentication handler for flexible token validation
A new 'Hybrid' authentication scheme has been introduced to the WebApi layer, allowing the system to validate access tokens from either the Authorization header or the query string. The implementation includes a dedicated handler that checks for an existing endpoint and allows public access if marked with \[AllowAnonymous\]. It first attempts to authenticate using the scheme specified in the Authorization header; if that fails or is absent, it falls back to extracting an 'access\_token' from the request query string and authenticates using the standard JWT Bearer scheme. This provides a more flexible way to handle hybrid authentication scenarios.
src/ServiceShared/WebApi/Authentication/Hybrid · high confidence
Added MongoDB repository implementation
A new MongoDbRepository class has been added to the infrastructure layer, providing a concrete implementation for MongoDB data access. This class implements standard repository operations including insert, update, delete, and query methods, allowing the application to interact with MongoDB data stores.
src/Infrastructures/Repository.EfCore.MongoDB/Repositories · high confidence
Added OutofMaxlengthException for encryption length validation
A new OutofMaxlengthException class has been introduced to handle cases where encrypted data exceeds the maximum allowed length. This exception captures specific details about the violation, including the maximum length, the RSA key size, and the encryption padding mode, allowing for more precise error handling and debugging when encryption operations fail due to length constraints.
src/Infrastructures/Helper/Internal/Encrypt/Exception · medium confidence
Added ServiceLocator to manage the root IServiceProvider instance
A new static ServiceLocator class has been added to the DependencyInjection infrastructure. It provides a centralized way to set, retrieve, and check the status of the root IServiceProvider instance, ensuring it is configured exactly once.
src/Infrastructures/Core/DependencyInjection · high confidence
Added SkyAPM distributed tracing for Redis cache operations
The Redis caching infrastructure now includes a new \CacheTracingDiagnosticProcessor\ that integrates with SkyAPM to automatically trace Get, Set, and Remove cache operations. This adds visibility into cache performance and errors via distributed tracing spans, allowing users to monitor cache hit/miss rates and latency through their existing APM tools.
src/Infrastructures/Redis.Caching · high confidence
Added cache statistics tracking
Introduced new classes to track cache hit and miss statistics. The \CacheStats\ class manages counters for hits and misses, while \CacheStatsCounter\ provides thread-safe increment and get operations. A \LocalVariables\ singleton holds a queue of cache key models, and a \StatsType\ enum distinguishes between hit and missed events.
src/Infrastructures/Redis.Caching/Core/Stats · high confidence
Added consistent hashing and HTTP context accessor utilities
The infrastructure layer now includes a new HashConsistentGenerater class that implements a consistent hashing algorithm using virtual nodes and MD5-based hashing to map keys to nodes, along with methods to add, remove, and retrieve nodes. Additionally, a new HttpContextAccessor class was added to provide access to the current HTTP context via reflection and expression trees, enabling internal components to retrieve the active HTTP context.
src/Infrastructures/Helper/Internal · high confidence
Added default CAP filter for event bus logging
A new DefaultCapFilter class has been introduced in the CAP infrastructure to handle subscription lifecycle events. It implements the SubscribeFilter interface to log errors when subscription execution fails, while allowing successful or executing states to pass through without modification.
src/Infrastructures/EventBus/Cap/Filters · high confidence
Added gRPC service and message definitions for admin configuration and dictionary options
New Protocol Buffers definitions were added to the shared protos directory, introducing gRPC service contracts and message types for retrieving system configuration lists and dictionary options. Specifically, admingrpc.proto defines the AdminGrpc service with methods to fetch sys config and dict options, while messages/common.proto, sys\_config.proto, and sys\_dictoption.proto define the corresponding request and reply structures.
src/Demo/Shared/protos · high confidence
Added internal helpers for EF Core expression conversion and key entry modeling
Introduced two new internal classes to support Entity Framework Core query building. ExpressionHelper provides a static method to convert expression trees into SetPropertyCalls, facilitating dynamic property mapping. KeyEntryModel is a new internal sealed class that models key entries with properties for property name, column name, and value, supporting the repository's internal query construction logic.
src/Infrastructures/Repository.EfCore/Internal · high confidence
Added load balancer implementations for Consul service discovery
The system now supports multiple load balancing strategies for Consul service discovery, including random selection and round-robin distribution. A new \ILoadBalancer\ interface and corresponding \RandomLoadBalancer\ and \RoundRobinLoadBalancer\ implementations have been added to the \Adnc.Infra.Consul.Discover.Balancers\ namespace, allowing the application to distribute traffic across discovered services using these algorithms.
src/Infrastructures/Consul/Discover/Balancers · high confidence
Added new model classes for repository interfaces
The repository interface layer now includes three new model classes: Operater, which defines an operator entity with Id, Account, and Name; PagedModel, a generic class for handling paginated data with properties for page index, page size, total count, and data; and RawSqlQueryModel, which provides QueryCondition for SQL query parameters and QueryPageResult for paginated SQL query results. These additions expand the available data structures for repository operations.
src/Infrastructures/Repository/Interface/Models · medium confidence
Added operation log interception for synchronous and asynchronous methods
The \OperateLogAsyncInterceptor\ and \OperateLogInterceptor\ classes have been added to the \ServiceShared\ application layer. These interceptors automatically capture operation logs for methods marked with the \OperateLogAttribute\, recording details such as method name, execution time, and arguments (serialized via \System.Text.Json\), and write them to a message queue channel for asynchronous processing.
src/ServiceShared/Application/Interceptors · high confidence
Added service registration for Yitter ID generator
A new extension method, AddAdncInfraYitterIdGenerater, has been added to the ServiceCollectionExtension class. This method configures the application's dependency injection container to register the Yitter-based ID generation services, including Redis configuration, a scoped WorkerNode, and a hosted service, while ensuring the registration is only performed once.
src/Infrastructures/IdGenerater/Extensions · high confidence
Added support for tracking and querying login and operation logs
The repository layer now includes a new \EntityInfo\ class that maps the \EventTracker\ entity to the \maint\_eventtracker\ database table, accompanied by the corresponding Entity Framework Core migration files to create the table and its unique index. Additionally, the \LogRepoExtension\ class was added to provide new methods for querying paged login and operation logs directly via SQL, allowing users to retrieve structured log data from the \login\_log\ and \operation\_log\ tables.
src/Demo/Maint/Repository · high confidence
Added timestamp conversion handler for Dapper
A new TimeStampeHandler class has been added to the Dapper infrastructure, enabling automatic conversion between byte array representations of Unix timestamps and DateTime objects. This allows the repository layer to seamlessly map timestamp fields in the database to C\# DateTime types and vice versa.
src/Infrastructures/Repository.Dapper/Internal · high confidence
Adds core extension methods for common types
The infrastructure layer introduces a comprehensive set of extension methods for various base types, including \DateTime\, \String\, \IEnumerable\, \Collection\, \Enum\, \Exception\, \HttpStatusCode\, \Int\, \Object\, \Random\, \Stream\, \StringBuilder\, \Assembly\, and \Expression\ (via \ExpressionCreator\, \ExpressionLogicalOperatorsExtension\, \ExpressionMethodsExtension\). New capabilities include converting byte arrays to memory streams or hex strings, checking if collections contain all or any of specified values, generating logical expression combinations, formatting exception details, and providing utility methods for date/time calculations and random number generation.
src/Infrastructures/Core/Extensions · high confidence
Admin application contracts and interfaces for dictionary, menu, organization, role, system config, and user management
The Admin application contracts layer now includes a comprehensive set of Data Transfer Objects (DTOs) and service interfaces for managing dictionaries, menus, organizations, roles, system configurations, and users. This includes creation, update, and retrieval DTOs for each domain, alongside service interfaces that define the operations (create, update, delete, get, search) for each entity. The change also introduces a centralized \CacheConsts\ class to manage cache keys and prefixes, replacing the previous dependency on a shared \Adnc.Demo.Const\ project, which improves code cohesion and maintainability.
src/Demo/Admin/Application.Contracts · high confidence
Admin repository adds database entities and mappings for system management
The Admin repository now includes entity classes and EF Core configuration classes for system management features, including Menu, Role, User, Organization, SysConfig, and Dictionary (Dict/DictData) models. These are mapped to database tables such as sys\_menu, sys\_role, sys\_user, sys\_organization, sys\_config, and sys\_dictionary. The EntityInfo class registers these entities with their corresponding table names, and a new migration (20260413140214\_Init) is generated to create the corresponding database schema.
src/Demo/Admin/Repository · high confidence
Customer management and event handling capabilities added to the Demo/Cust service
The Demo/Cust service now supports full customer lifecycle management, including creating customers, recharging balances, and viewing transaction logs. This is enabled by new API controllers, application services, and DTOs for customer data. The service also implements idempotent event handling for order payments and customer recharges via CAP subscribers, ensuring reliable processing of distributed events. Additionally, the service registers dependencies for MySQL, Redis, and RabbitMQ, and includes database migrations to persist customer, finance, and transaction log data.
src/Demo/Cust · high confidence
Introduce CacheValue wrapper and caching constants
Added CacheValue\<T\> to provide a typed wrapper for cache entries with null-safety checks (HasValue, IsNull) and a static Null/NoValue singleton. Added CachingConstValue to centralize configuration constants, including a 5-second Polly timeout and default serializer/provider names for StackExchange, FreeRedis, ServiceStack, and CSRedis.
src/Infrastructures/Redis.Caching/Core/Internal · high confidence
Introduce CapPublisher and NullCapPublisher for event bus operations
The event bus infrastructure now includes a CapPublisher that wraps the DotNetCore.CAP library to handle message publishing and delayed publishing, as well as a NullCapPublisher for testing scenarios where no actual message delivery is required. This change provides a concrete implementation of the IEventPublisher interface for CAP-based messaging and a no-op alternative for unit tests.
src/Infrastructures/EventBus/Cap · medium confidence
Introduce Dapper-based repository implementation
The \DapperRepository\ class has been added to the \src/Infrastructures/Repository.Dapper\ location, implementing the \IAdoExecuterWithQuerierRepository\ interface. This new component provides a concrete data access layer using Dapper, featuring methods for executing and querying databases across MySQL, SQL Server, and Oracle. It manages database connections and supports read/write routing via the \writeDb\ parameter in query methods.
src/Infrastructures/Repository.Dapper · high confidence
Introduce EF Core repository implementations
Added new repository classes (AbstractEfBaseRepository, EfBasicRepository, EfRepository) that provide data access methods for Entity Framework Core, including query, insert, update, and delete operations with support for soft deletes and audit information.
src/Infrastructures/Repository.EfCore/Repositories · high confidence
Introduce MongoDB entity and context infrastructure
The repository now includes a new MongoDB-specific entity base class (MongoEntity) and a corresponding context (MongoDbContext) that inherit from existing EF Core abstractions. This adds the foundational types and configuration hooks needed to map MongoDB documents to entity models within the data access layer.
src/Infrastructures/Repository.EfCore.MongoDB · high confidence
Introduce MongoDB repository service registration with configurable lifetime
The ServiceCollectionExtension class has been added to the project, providing an extension method to register MongoDB database context and repository services. This registration supports a configurable ServiceLifetime (defaulting to Scoped) and includes null-checks to prevent duplicate registrations, ensuring consistent service resolution for MongoDB data access.
src/Infrastructures/Repository.EfCore.MongoDB/Extensions · high confidence
Introduce RabbitMQ infrastructure components
Added new files for the RabbitMQ event bus implementation, including the base consumer, producer, and connection manager, along with configuration models for exchanges and queues.
src/Infrastructures/EventBus/RabbitMq · high confidence
Introduce Redis caching interceptor attributes and key generation
Added new attributes (CachingAbleAttribute, CachingEvictAttribute, CachingPutAttribute, CachingParamAttribute) and a default cache key generator (DefaultCachingKeyGenerator) to the Redis caching infrastructure. These components enable method-level caching interception, allowing developers to configure cache expiration, eviction, and key generation strategies directly on methods and parameters.
src/Infrastructures/Redis.Caching/Core/Interceptor · high confidence
Introduce Redis infrastructure interfaces and global usings
Added new files in the Redis infrastructure layer: GlobalUsings.cs provides global using directives for common libraries, while IDistributedLocker.cs and IRedisProvider.cs define the distributed locking and Redis caching provider interfaces, respectively.
src/Infrastructures/Redis · high confidence
Introduce Redis-backed Bloom filter caching with hot-swap support
A new Bloom filter caching layer has been added to the Redis infrastructure, providing a distributed, probabilistic set for membership testing. The implementation includes an abstract base class (AbstractBloomFilter) that handles initialization, locking, and Redis operations (BfAdd, BfExists, BfReserve), along with a factory (BloomFilterFactory) that selects between the active Redis implementation and a NullBloomFilter (which always returns true) based on the 'EnableBloomFilter' configuration option. A background service (BloomFilterHostedService) ensures all registered filters are initialized at startup. This allows the application to leverage Redis for efficient, memory-optimized set operations, with the ability to disable the feature entirely via configuration.
src/Infrastructures/Redis.Caching/Core/BloomFilter · high confidence
Introduce Whse (Warehouse) demo service with product and warehouse management APIs
A new demo service for warehouse management has been added, exposing RESTful endpoints for creating and managing products and warehouse shelves. The API includes controllers for product operations (create, update, change price, put on/off sale, list, and pagination) and warehouse shelf operations (create, allocate to product, and list). The implementation features domain models for Product and Warehouse, domain services for business logic, and Entity Framework Core configurations that map to database tables. The service is configured with dependency injection, health checks for SQL Server, Redis, and RabbitMQ, and uses Consul for configuration in non-development environments.
src/Demo/Whse/Api · high confidence
Introduce base service interfaces for application and remote clients
Added empty marker interfaces IAppService and IRestClient to the shared contracts and remote HTTP layers, providing base types for application services and REST client implementations.
src/ServiceShared/Application.Contracts/Interfaces, src/ServiceShared/Remote/Http · high confidence
Introduce basic and Bearer token generation and validation handlers
Added new token handling components in the ServiceShared module, including \BasicOptions\ for configuration, \BasicTokenGenerator\ and \BearerTokenGenerator\ for creating tokens, and \BasicTokenValidator\ for validating and unpacking basic authentication tokens. The \TokenFactory\ now resolves token generators by scheme, and \ITokenGenerator\ defines the interface for all token generators.
src/ServiceShared/Remote/Handlers/Token · high confidence
Introduce centralized DI extensions for CAP and RabbitMQ infrastructure
A new \ServiceCollectionExtension\ class has been added to the EventBus infrastructure, providing \AddAdncInfraCap\ and \AddAdncInfraRabbitMq\ methods to configure the CAP event bus and RabbitMQ integration. The CAP registration supports multiple subscriber types via a generic filter parameter and integrates with SkyAPM for distributed tracing. The RabbitMQ registration manages connection pooling via a \ConnectionManager\ and automatically registers all exported types inheriting from \BaseRabbitMqConsumer\ as hosted services.
src/Infrastructures/EventBus/Extensions · medium confidence
Introduce custom JSON converters and configuration for System.Text.Json
The framework now provides built-in support for serializing and deserializing boolean, DateTime, and nullable DateTime values using the System.Text.Json library. A new \SystemTextJson\ utility class exposes \GetAdncDefaultOptions\ to configure serialization behavior, including camel-case naming policies, comment skipping, and custom converters that map booleans to integers and dates to formatted strings. This allows the application to handle these specific data types consistently during JSON serialization and deserialization.
src/Infrastructures/Core/Json · high confidence
Introduce internal Redis core utilities and constants
Added three new internal classes to the Redis infrastructure layer: AutoDelayTimers, which manages a thread-safe dictionary of timers; ConstValue, which defines serialization and provider name constants; and TypeHelper, which provides a regex-based method to build type names. These files establish the internal support structures for the Redis core module.
src/Infrastructures/Redis/Core/Internal · high confidence
Introduce log query capabilities for login, operation, and NLog entries
The application layer now includes a new \ILogService\ interface and \LogService\ implementation that expose paged query endpoints for login logs, operation logs, and NLog entries. This adds the ability to retrieve and filter these logs via the \GetLoginLogsPagedAsync\ and \GetOperationLogsPagedAsync\ methods, supporting date range and keyword filtering. The \MaintProfile\ AutoMapper configuration maps the corresponding DTOs, and the \DependencyRegistrar\ registers these services, enabling the maintenance module to access and display log data.
src/Demo/Maint/Application · high confidence
Introduce maintenance API with login and operation log endpoints
The maintenance service now exposes REST endpoints for querying login and operation logs. Route constants are defined in \Consts.cs\, and controllers (\LoginLogController\, \OperationLogController\) provide paginated access to these logs, secured by specific permissions (\operationlog-search\, \loginlog-search\). The API is bootstrapped via \DependencyRegistrar\ and \MiddlewareRegistrar\, with environment-specific configurations for MySQL, Redis, RabbitMQ, and Consul in \appsettings.\*.json\ files.
src/Demo/Maint/Api · high confidence
Introduce order management application layer
Added the application layer for the Order domain, including the \IOrderService\ interface and \OrderService\ implementation that handles creating, updating, paying, and canceling orders. The change introduces DTOs for order creation, search, and display, along with a \WarehouseQtyBlockedEventSubscriber\ to process inventory reservation events. Dependency injection and caching infrastructure are also initialized in this layer.
src/Demo/Ord/Application · high confidence
Introduce product and warehouse management capabilities in the demo application
The demo application now includes full application-layer support for managing products and warehouses. This includes new DTOs for product creation, updates, pricing, and status changes, as well as warehouse allocation and inventory blocking. The \ProductService\ and \WarehouseService\ implement their respective interfaces to handle CRUD operations, with the warehouse service also subscribing to \OrderCreatedEvent\ to reserve inventory. A \DependencyRegistrar\ wires up the services, including CAP event bus integration for the \OrderCreatedEventSubscriber\.
src/Demo/Whse/Application · high confidence
Introduce shared encryption helper classes and RSA provider
Added new internal helper classes in the encryption shared folder: \AESKey\, \MD5Length\, \RSAKey\, \RSAParametersJson\, \RsaKeyType\, \RsaSize\, and \RsaProvider\. The \RsaProvider\ class provides methods to convert RSA keys to and from PEM format, supporting both PKCS\#1 and PKCS\#8 standards, as well as public and private key extraction. These changes improve the internal infrastructure for handling cryptographic keys and parameters.
src/Infrastructures/Helper/Internal/Encrypt/Shared · high confidence
Introduce structured error and result models for the application layer
Added new \ProblemDetails\ and \ServiceResult\/\ServiceResult\<T\>\ classes to \src/ServiceShared/Application.Contracts/ResultModels\. The \ProblemDetails\ model standardizes error responses with status codes, titles, and instance details, while the \ServiceResult\ wrappers provide a consistent way to handle success/failure states and error propagation in application services.
src/ServiceShared/Application.Contracts/ResultModels · medium confidence
Introduced new domain entity base classes
Added new base classes for domain entities, including AggregateRoot, DomainEntity, and ValueObject, to support domain-driven design patterns. AggregateRoot now includes concurrency support via a RowVersion property and lazy-loaded event publishing, while AggregateRootWithBasicAuditInfo adds standard audit fields (CreateBy, CreateTime). The AbstractDomainEntityInfo class provides reflection-based entity type discovery, and DomainEntity serves as a minimal entity base. These changes establish a consistent foundation for domain modeling.
src/ServiceShared/Domain/Entities · high confidence
Introduces AbstractAppService base class for shared service functionality
A new abstract base class, AbstractAppService, has been added to the application services layer. This class implements the IAppService interface and provides shared, static helper methods for service implementations, including access to an IObjectMapper via a ServiceLocator, utility methods for creating ServiceResult and ProblemDetails responses, and a helper for generating update property expressions. This change standardizes how application services access shared dependencies and format responses.
src/ServiceShared/Application/Services · high confidence
Introduces AdncControllerBase with helper methods for error and result handling
A new base controller class, AdncControllerBase, has been added to the WebApi layer. It provides protected helper methods (Problem, Result, CreatedResult) that convert internal service results and exceptions into standard ASP.NET Core action results, centralizing how errors and success states are returned to the client.
src/ServiceShared/WebApi/Controller · high confidence
Introduces UnitOfWork class with transaction and logging support
The UnitOfWork class now provides explicit control over database transactions, including BeginTransaction, Commit, CommitAsync, Rollback, and RollbackAsync methods. It also integrates structured logging via Microsoft.Extensions.Logging to record transaction start, commit, and rollback events, improving observability for database operations.
src/Infrastructures/Repository.EfCore/Transaction · high confidence
Introduces a background service for cache preheating and cache removal
The system now includes a new \CachingHostedService\ that runs in the background to preheat caches via \ICachePreheatable\ implementations and periodically process a queue of cache keys to remove. This adds a new infrastructure component for proactive cache warming and background cache invalidation.
src/Infrastructures/Redis.Caching/Core/Preheater · high confidence
Introduces a new permission-based authorization system for the Web API layer
The authorization module in src/ServiceShared/WebApi/Authorization has been restructured and expanded with new files to support granular permission checks. This includes the AdncAuthorizeAttribute for marking endpoints, a PermissionRequirement class, and two distinct authorization handlers: PermissionCacheHandler which validates permissions against a cached role-permission mapping, and PermissionRemoteHandler which validates permissions via a remote authentication service. The AbstractPermissionHandler provides the common logic for extracting permission codes from request headers, query parameters, or the request URL, allowing services to enforce access control based on user permissions.
src/ServiceShared/WebApi/Authorization · high confidence
Introduces new argument and variable validation utilities
Adds new classes for input validation: ArgumentChecker provides static methods to validate that arguments are not less than or equal to zero, not null or empty, and within specified ranges; VariableChecker offers similar checks for variables, throwing BusinessException or InvalidVariableException with specific HTTP status codes (521, 520) when validation fails. These utilities are exposed via a unified Checker class for easy access.
src/Infrastructures/Core/Guard · high confidence
Introduces shared WebApi extension methods for configuration, health checks, and host setup
The \src/ServiceShared/WebApi/Extensions\ directory now contains a set of new extension classes that provide a unified way to configure and bootstrap a WebApi service. \WebApplicationBuilderExtension\ handles configuration loading (supporting File, Consul, Nacos, and Etcd backends) and logging setup. \HostExtension\ adds methods for service registration (Consul/Nacos) and dynamic ThreadPool tuning. \ServiceCollectionExtension\ provides a generic \AddAdnc\ method to register all shared services. \HealthChecksBuilderExtension\ adds specific health checks for MySQL, Redis, and RabbitMQ. \WebApplicationrExtension\ applies shared middleware. \ModelStateExtension\ and \JWTOptionsExtension\ provide utility methods for model state formatting and JWT validation parameters. \ServiceInfoExtension\ generates a default navigation page content.
src/ServiceShared/WebApi/Extensions · high confidence
Introduces shared service, configuration, and user context models
Adds new shared components to the application's service layer. ServiceInfo.cs introduces a singleton ServiceInfo class that generates unique service identifiers based on environment and assembly metadata, alongside an interface defining service metadata. SystemConsts.cs adds a set of static classes containing configuration keys and constants for various system settings (e.g., Redis, MySQL, JWT, Logging). UserContext.cs provides a UserContext class to hold current user session data including ID, account, name, email, role IDs, and device information.
src/ServiceShared/Shared · high confidence
MySQL EF Core context and global usings added
The MySQL-specific Entity Framework Core context (MySqlDbContext) was added, configuring the database to use the utf8mb4 character set. Global using directives were introduced to streamline imports for System.Data, the Adnc repository layers, CAP, and Microsoft.EntityFrameworkCore types.
src/Infrastructures/Repository.EfCore.Mysql · high confidence
New EF Core extension methods for entity keys, lazy loading, DI registration, and expression building
The repository infrastructure now provides new extension methods to improve Entity Framework Core integration. EntityEntryExtension adds GetKeyValues to retrieve primary key values and GetColumnName for column mapping. PocoLoadingExtension introduces a generic Load method to support lazy loading patterns. ServiceCollectionExtension registers EntityInfo, Unit of Work interceptors, and EF Core repositories via the DI container. SetPropertyCallsExtensions adds an Append method to combine expression trees for property setting. These changes streamline repository setup and entity metadata access.
src/Infrastructures/Repository.EfCore/Extensions · high confidence
New HTTP message types for login and user validation
Two new C\# classes have been added to the HTTP messages layer: LoginResponse, which carries authentication tokens, and UserValidatedInfoResponse, which reports validation status and version. These types support the authentication and user-validation flows by providing structured response models for these endpoints.
src/ServiceShared/Remote/Http/Messages · high confidence
New StackExchange.Redis provider implementation
Added a new \DefaultDatabaseProvider\ and \DefaultRedisProvider\ implementation for the StackExchange.Redis client. This includes full support for string, hash, list, set, sorted set, bitmap, geo, bloom filter, hyperloglog, and stream data types, along with distributed locking and script evaluation capabilities.
src/Infrastructures/Redis/Providers · high confidence
New authentication processor architecture for Bearer token validation
The codebase introduces a new authentication processing layer under src/ServiceShared/WebApi/Authentication/Processors. An abstract base class, AbstractAuthenticationProcessor, defines the core validation logic for Bearer tokens, extracting user ID and validating against a versioned status. Two concrete implementations are added: BearerAuthenticationCacheProcessor, which retrieves validation info from a cache provider, and BearerAuthenticationRemoteProcessor, which fetches it via an HTTP client. This structure separates cache-based and remote-based validation strategies while sharing common claim validation logic.
src/ServiceShared/WebApi/Authentication/Processors · high confidence
New background services for processing login and operation logs via channels
Added ChannelAccessor and LogConsumersHostedService to handle background processing of login and operation logs. The ChannelAccessor provides a static, thread-safe accessor for bounded channels that drop oldest items when full. The LogConsumersHostedService runs as a background task that reads from these channels and inserts log records into the database using ADO.NET, batching inserts of up to 100 records at a time.
src/ServiceShared/Application/Channels · high confidence
New base DTOs for shared application contracts
Added a set of new base classes and interfaces in the Application.Contracts layer to standardize data transfer objects. This includes the IDto marker interface, input DTOs (InputDto, InputSimpleDto), output DTOs (OutputDto, OutputBaseAuditDto, OutputFullAuditInfoDto), search/pagination models (SearchDto, SearchPagedDto, PageModelDto), and utility wrappers (SimpleDto, OptionTreeDto). These provide a consistent foundation for API request/response structures and pagination.
src/ServiceShared/Application.Contracts/Dtos · high confidence
New build, deployment, and configuration files for the .NET 8.0 solution
The repository now includes a comprehensive set of infrastructure and configuration files to support the project's build and deployment workflows. A .editorconfig file enforces C\# code style, formatting, and diagnostic rules. A Directory.Build.props file sets the target framework to .NET 8.0 and enables implicit usings and nullable reference types. Deployment is automated via shell scripts (deploy\_demo.sh and deploy\_ocelot.sh) that publish the solution, build Docker images for the demo and Ocelot gateway services, and manage container lifecycle. Additionally, a .dockerignore file is provided to exclude unnecessary files from Docker builds, and a .gitattributes file configures line-ending and merge-driver settings for the repository.
src · high confidence
New configuration models for Redis connection and serialization settings
Added three new configuration classes to the Redis infrastructure layer: DBOptions, which defines connection parameters such as username, password, SSL settings, endpoints, and database index; RedisOptions, which holds provider type, bloom filter enablement, and serialization configuration; and ServerEndPoint, which models individual Redis server hosts and ports. These classes provide the structured configuration options needed to connect to and interact with the Redis cache.
src/Infrastructures/Redis/Configurations · high confidence
New domain models and EF Core configurations for logging and event tracking
The repository layer now includes new domain models for tracking login and operation logs, as well as event tracking data. Specifically, Dapper entities for LoginLog and OperationLog have been added to support database access for these logs. Additionally, an EF Core entity for EventTracker has been introduced, along with its corresponding EntityTypeConfiguration, which enforces a unique composite index on EventId and TrackerName. These changes expand the system's capability to record and query user activity and system events.
src/ServiceShared/Repository · high confidence
New repository interface contracts for EF, MongoDB, and raw SQL execution
The repository layer introduces a set of new interface contracts that standardize data access across different storage backends. For Entity Framework, the system now exposes \IEfBaseRepository\, \IEfBasicRepository\, and \IEfRepository\, providing methods for CRUD operations, batch updates, and raw SQL execution. For MongoDB, \IMongoDbRepository\ is introduced with similar create, update, and delete capabilities. Additionally, \IAdoRepository\, \IAdoExecuterRepository\, and \IAdoQuerierRepository\ define interfaces for executing raw SQL queries and commands, while \IUnitOfWork\ and \IRepository\ provide the base abstractions for transaction management and generic repository operations.
src/Infrastructures/Repository/Interface · high confidence
New shared extension methods for HTTP client policies and environment utilities
The ServiceShared layer introduces three new extension classes to centralize HTTP client configuration and environment handling. DependencyRegistrarExtension now provides default retry, timeout, and circuit-breaker policies for REST and gRPC clients, along with environment detection and short-name mapping. HttpClientBuilderExtension adds a helper to apply these policies to HttpClientBuilder instances. SearchPagedDtoExtension adds a utility to calculate skip rows for pagination. These changes standardize resilience patterns and environment checks across the application.
src/ServiceShared/Application/Extensions · high confidence
Ocelot gateway initialization and configuration
The Ocelot gateway now initializes with a new project structure that supports both file-based and Consul-based configuration. Users can choose their configuration source via the ConfigurationType setting, with Consul URLs and keys defined in environment-specific appsettings files. The gateway also introduces a custom IP address resolution for Consul service discovery, configures JWT authentication with customizable expiration and validation settings, and applies thread pool tuning via ThreadPoolSettings. A default landing page displays environment information and active routes.
src/Gateways/Ocelot · high confidence
Shared project structure and build configuration established
The Adnc.Shared solution is now defined with a new solution file that includes the WebApi, Shared, Application, Application.Contracts, Domain, Repository, and Remote projects. A Directory.Build.props file has been added to centralize build properties, including versioning (1.0.2), package metadata (icon, license, copyright), and source link configuration. Additionally, an OperateLogAttribute class has been introduced in the Application.Contracts layer to support operation logging.
src/ServiceShared · high confidence
Architecture
Infrastructure layer adopts unified versioning and build configuration
The \src/Infrastructures\ directory now includes a \Directory.Build.props\ file that centralizes build properties for the \Adnc.Infra\ solution. This configuration sets the default version to 1.0.2 and defines metadata for NuGet package generation, including the MIT license, copyright holder (ADNC), and inclusion of symbols and source link. The \Adnc.Infra.sln\ solution file was also added, explicitly listing all infrastructure sub-projects (Core, Helper, Consul, Repository, EventBus, etc.) and their build configurations.
src/Infrastructures · high confidence
Behavioural changes
Add global usings to infrastructure modules
Global using directives have been added to the IdGenerater and Repository modules, importing common dependencies such as Microsoft.Extensions.Configuration, Microsoft.Extensions.Hosting, Microsoft.Extensions.Logging, System.Data, and System.Linq.Expressions. This simplifies namespace usage across these infrastructure components.
src/Infrastructures/IdGenerater, src/Infrastructures/Repository, src/Infrastructures/Repository.EfCore.MongoDB/Transaction · high confidence
AddAdncInfraRedis method now supports multiple Redis providers and validates inputs
The AddAdncInfraRedis extension method has been updated to accept an IConfigurationSection and ServiceLifetime, with strict null-checking for both parameters. It now supports multiple Redis providers (StackExchange, ServiceStack, FreeRedis, CSRedis) via a switch statement, allowing users to configure different Redis implementations. The method also includes a guard clause to prevent duplicate registration. This change enables more flexible Redis configuration in the application's dependency injection setup.
src/Infrastructures/Redis/Extensions · high confidence
Admin API introduces structured permission constants and localized route definitions
The Admin API now defines route prefixes and granular permission identifiers in a new \Consts.cs\ file, replacing external or shared constant sources. Controllers for users, roles, menus, organizations, dictionaries, and system configurations now reference these local constants for authorization and routing, ensuring that permission checks and URL structures are self-contained within the Admin API project.
src/Demo/Admin/Api · high confidence
Centralizes common .NET and Microsoft.Extensions namespaces
A new GlobalUsings.cs file has been added to the Core infrastructure layer, automatically importing common namespaces such as System.Collections.Concurrent, System.Diagnostics.CodeAnalysis, System.Net, System.Reflection, and Microsoft.Extensions.Configuration and Hosting. This change reduces the need for explicit using statements in individual files, simplifying the codebase and ensuring consistent access to frequently used types across the project.
src/Infrastructures/Core · high confidence
Centralizes shared API dependencies and exposes thread pool configuration
The WebApi project now imports a broad set of shared and framework namespaces (including JWT, FluentValidation, HealthChecks, Prometheus, and Microsoft.AspNetCore.\* libraries) via a new GlobalUsings.cs file, simplifying type resolution across the service. Additionally, a new ThreadPoolSettings class is introduced to expose configurable thread pool parameters (MinThreads, MinCompletionPortThreads, MaxThreads, MaxCompletionPortThreads) for the application.
src/ServiceShared/WebApi · high confidence
Consolidates global usings and introduces a dedicated SqlServerDbContext
The SqlServer-specific context class is now defined in its own file (SqlServerDbContext.cs) and relies on a new GlobalUsings.cs to manage shared imports, reducing boilerplate in individual files. This change streamlines the repository infrastructure by centralizing namespace declarations and providing a clear, lightweight DbContext implementation for SQL Server.
src/Infrastructures/Repository.EfCore.SqlServer · high confidence
Consolidates infrastructure helpers and global usings
The src/Infrastructures/Helper directory now contains a new GlobalUsings.cs file that imports common .NET and ASP.NET Core namespaces globally, reducing the need for explicit using statements in other files. Additionally, a new InfraHelper.cs static class has been introduced to provide a unified access point for encryption, hash consistency generation, and HTTP context access, effectively consolidating these utility functions into a single, easily accessible location.
src/Infrastructures/Helper · medium confidence
Consul infrastructure adds global using directives for key libraries
The Consul infrastructure layer now includes a GlobalUsings.cs file that establishes global using directives for System.Net, the Consul client library, and several Microsoft.Extensions packages (Configuration, DependencyInjection, Hosting, Logging, and Options). This change simplifies code in the Consul infrastructure by making these namespaces available throughout the project without requiring explicit using statements in each file.
src/Infrastructures/Consul · medium confidence
Custom SQL generation for MyCAT master routing
The MySQL repository infrastructure now includes a custom SQL generation pipeline for MySQL queries. A new \AdncMySqlQuerySqlGeneratorFactory\ and \AdncQuerySqlGenerator\ override the default EF Core/MySql query generation to intercept the SQL generation process. Specifically, the generator detects a \MYCAT\_ROUTE\_TO\_MyCAT\_ROUTE\_TO\MASTER\ tag and injects a MyCAT annotation (\/\\#mycat:db\type=master\/\) into the generated SQL. This instructs the MyCAT database middleware to route the query to the master database instance, ensuring write operations are directed to the correct node in a read/write splitting architecture.
src/Infrastructures/Repository.EfCore.Mysql/SqlGenerator · high confidence
Demo solution reorganized with centralized build and versioning configuration
The demo project structure has been reorganized to improve maintainability and build consistency. A new \Directory.Build.props\ file has been introduced to centralize versioning (setting the default version to 1.0.2) and apply specific build configurations, such as garbage collection settings for API projects. The \Adnc.Demo.sln\ solution file has been updated to reflect the new directory structure, grouping shared resources, NLog configurations, and all demo sub-projects (Admin, Maint, Cust, Ord, Whse) into a cleaner, hierarchical layout.
src/Demo · medium confidence
Introduce IObjectMapper interface and AutoMapperObject implementation
The codebase now includes a new abstraction for object mapping via the IObjectMapper interface and its AutoMapperObject implementation. This change provides a consistent, type-safe way to map objects using AutoMapper, with support for single and multi-type mappings, as well as an overload that sets an entity's Id during mapping. This replaces the previous Adnc.Infra.Mapper-based approach with a more explicit, interface-driven design.
src/ServiceShared/Application/Mapper · medium confidence
Introduce new domain event classes for order and customer workflows
The \src/Demo/Shared/Remote.Event\ directory now contains five new event classes—\CustomerRechargedEvent\, \OrderCanceledEvent\, \OrderCreatedEvent\, \OrderPaidEvent\, and \WarehouseQtyBlockedEvent\—all inheriting from \BaseEvent\. These classes define the data contracts for various business events, such as order creation, payment, cancellation, customer recharge, and warehouse quantity blocking, enabling the system to handle these specific state changes.
src/Demo/Shared/Remote.Event · medium confidence
Introduced base entity and audit interfaces for the repository layer
Added new base classes and interfaces in the \src/Infrastructures/Repository/Entities\ directory to standardize entity definitions. This includes \EfEntity\ and \Entity\ as base classes, along with interfaces for audit information (\IBasicAuditInfo\, \IFullAuditInfo\), concurrency control (\IConcurrency\), and soft deletion (\ISoftDelete\). These changes provide a consistent foundation for entity mapping and behavior within the repository infrastructure.
src/Infrastructures/Repository/Entities · high confidence
New RPC configuration model and global usings
The Remote service shared library now includes a new RpcInfo model that defines the structure for RPC configuration, including address nodes (service, direct, Consul, and CoreDns endpoints) and Polly settings. Additionally, GlobalUsings.cs was added to provide global using directives for common namespaces like System.Net.Http.Headers, Microsoft.AspNetCore.Http, and Microsoft.Extensions.DependencyInjection, streamlining access to these types across the project.
src/ServiceShared/Remote · medium confidence
Refactored Admin application layer with centralized caching and dependency injection
The Admin application layer has been reorganized to improve maintainability and decouple dependencies. A new \CacheService\ and associated bloom filters (\AccountBloomFilter\, \CacheKeyBloomFilter\) have been introduced to manage cache preheating and penetration protection for menus, organizations, and dictionaries. All service implementations (e.g., \MenuService\, \RoleService\, \UserService\) now utilize this centralized caching strategy, replacing direct repository calls with cache-first logic where appropriate. Additionally, a \DependencyRegistrar\ has been added to standardize the registration of application-layer services and repositories, while global usings and mapper profiles have been consolidated to streamline the codebase.
src/Demo/Admin/Application · high confidence
Refactored EF Core entity configuration and audit field handling
The EF Core infrastructure has been restructured to improve entity mapping and audit field management. A new \AbstractEntityInfo\ class now centralizes model creation logic, automatically applying configurations from assemblies and setting table/column comments. The \AbstractEntityTypeConfiguration\ provides a standardized way to configure entity types, including primary keys, concurrency tokens, soft-delete filters, and audit info (create/modify by/time). The \AdncDbContext\ has been simplified, with \SetAuditFields\ automatically populating audit fields during \SaveChangesAsync\. Additionally, a \NullEntityInfo\ implementation is provided for scenarios where no entity mapping is needed.
src/Infrastructures/Repository.EfCore · high confidence
Refactored WebApi dependency registration and middleware pipeline
The WebApi shared library has been refactored to improve encapsulation and consistency. The \AbstractWebApiDependencyRegistrar\ class has been split into partial classes for Authentication, Authorization, Controllers, CORS, MiniProfiler, and Swagger, each handling their respective registrations. The authentication registration now supports Hybrid, Basic, and JWT Bearer schemes with custom claim mapping and error handling. The controller registration configures System.Text.Json serialization options, FluentValidation, and API behavior options. The middleware registrar (\AbstractWebApiMiddlewareRegistrar\) has been updated to include static files, real IP, custom exception handling, CORS, Swagger UI, MiniProfiler, health checks, routing, and metrics collection. The main entry point \AddWebApiDefaultServices\ now orchestrates these registrations and middleware in a structured manner.
src/ServiceShared/WebApi/Registrar · high confidence
Refactored application dependency registration with modular service registration
The application dependency registrar has been restructured into separate partial classes for domain services, event bus (CAP), EF Core, and RPC clients (REST/gRPC). This change improves code maintainability and encapsulation by removing dependencies on the contract layer for automatic service scanning, switching FluentValidation registration to the application layer, and standardizing the registration of dependencies such as CAP, EF Core, and HTTP/gRPC clients. The base registrar now handles common services like AutoMapper, Redis caching, and message tracking, while specific implementations are delegated to the new modular files.
src/ServiceShared/Application/Registrar · high confidence
Refactored authentication client interface to expose session and permission endpoints
The IAuthRestClient interface was refactored to define methods for retrieving authentication information, specifically adding GetValidatedInfoAsync to fetch session data and GetCurrenUserPermissionsAsync to retrieve a user's permissions. The interface now explicitly exposes these two REST endpoints, with the permissions method accepting user ID, a list of requested permissions, and role IDs as query parameters.
src/ServiceShared/Remote/Http/Services · medium confidence
Refactored global usings and introduced IDomainService interface
The src/ServiceShared/Domain directory was restructured to improve code organization and namespace management. A new GlobalUsings.cs file was added to centralize global using directives for the Adnc.Infra and Microsoft.Extensions.DependencyInjection namespaces. Additionally, a new IDomainService interface was introduced in the Adnc.Shared.Domain namespace, providing a base contract for domain services.
src/ServiceShared/Domain · medium confidence
Refactored message tracking system with new service implementations
The message tracking system has been refactored to improve maintainability and clarity. A new DbMessageTrackerService has been introduced to handle event tracking via a database repository, while a RedisMessageTrackerService has been added for Redis-based tracking. A NullMessageTrackerService provides a no-op implementation, and a MessageTrackerFactory has been created to manage and select between different tracker implementations. These changes replace the previous tracking mechanism, providing a more modular and extensible approach to message tracking.
src/ServiceShared/Application/Services/Trackers · medium confidence
Standardized global usings for shared JSON and HTTP types
Global using directives have been added to centralize access to System.Net, System.Text.Json, and related serialization types, reducing the need for explicit namespace imports across the Application.Contracts layer.
src/ServiceShared/Application.Contracts · high confidence
Test coverage
Add unit tests for encryption and hashing helpers; Added unit tests for Consul integration; Added unit tests for EF Core and MongoDB repository operations; Added unit tests for Redis caching and ID generation; Updated test solution structure to include MongoDB and repository unit tests.
Dependencies
Adopts Central Package Management for unified package version control
The project now uses Central Package Management (CPVM) to manage NuGet package versions in a single \Directory.Packages.props\ file. This change removes individual \Version\ attributes from each \.csproj\ file, ensuring all packages are versioned consistently across the solution and simplifying dependency maintenance.
(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 55 → 51 (-3.8)
- Rubric changed (rubric-2026.08.18 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 75 → 70 (-4.9)
- Architecture 72 → 73 (+0.1)
- Maturity 70 → 74 (+3.2)
- Readiness 63 → 49 (-13.6)
- Security 55 → 52 (-3.6)
- Domain Modelling 47 → 44 (-2.8)
- Event-Driven 100 (new)
Resolved (61)
- Bounded contexts not declared
- Change coupling: BasicTokenGenerator.cs ↔ BearerTokenGenerator.cs (src/ServiceShared/Remote/Handlers/Token/BasicTokenGenerator.cs)
- Change coupling: BearerTokenGenerator.cs ↔ TokenFactory.cs (src/ServiceShared/Remote/Handlers/Token/BearerTokenGenerator.cs)
- Change coupling: CacheDelegatingHandler.cs ↔ TokenFactory.cs (src/ServiceShared/Remote/Handlers/CacheDelegatingHandler.cs)
- Change coupling: ITokenGenerator.cs ↔ TokenDelegatingHandler.cs (src/ServiceShared/Remote/Handlers/Token/ITokenGenerator.cs)
- CommentedOutCode (src/ServiceShared/WebApi/Authentication/Bearer/BearerAuthenticationHandler.cs)
- CommentedOutCode (src/ServiceShared/WebApi/Authentication/Bearer/BearerAuthenticationHandler.cs)
- CommentedOutCode (src/ServiceShared/WebApi/Authentication/Bearer/BearerAuthenticationHandler.cs)
- CommentedOutCode (src/ServiceShared/WebApi/Authentication/Bearer/BearerAuthenticationHandler.cs)
- CommentedOutCode (src/ServiceShared/WebApi/Authentication/Bearer/BearerAuthenticationHandler.cs)
- CommentedOutCode (src/ServiceShared/WebApi/Authentication/Bearer/BearerAuthenticationHandler.cs)
- Duplicated block (10 lines × 2) (src/Infrastructures/Core/Extensions/Expression/ExpressionLogicalOperatorsExtension .cs)
- Duplicated block (10 lines × 2) (src/Infrastructures/Core/Extensions/Expression/ExpressionLogicalOperatorsExtension .cs)
- Duplicated block (10 lines × 2) (src/ServiceShared/Application/Channels/LogConsumersHostedService.cs)
- Duplicated block (10 lines × 3) (src/Infrastructures/Core/Extensions/DateTime/DataTimeExtension.cs)
- Duplicated block (11 lines × 2) (src/Infrastructures/Helper/Internal/Encrypt/EncryptProvider.Des.cs)
- Duplicated block (12 lines × 2) (src/Infrastructures/Redis/Providers/StackExchange/DefaultRedisProvider.List.cs)
- Duplicated block (12 lines × 2) (src/Infrastructures/Redis/Providers/StackExchange/DefaultRedisProvider.List.cs)
- Duplicated block (14 lines × 2) (src/ServiceShared/WebApi/Authorization/Handlers/PermissionCacheHandler.cs)
- Duplicated block (16 lines × 2) (src/Infrastructures/Helper/Internal/Encrypt/EncryptProvider.Rsa.cs)
- …and 41 more
New (342)
- Ambiguous naming for menu retrieval operations. GetMenusForRouterAsync and GetMenuOptionsAsync both return lists of menu-related DTOs (RouterTreeDto and OptionTreeDto respectively) but serve different presentation needs. The names do not clearly distinguish the output format or use case, leading to potential confusion about which method to call for a specific UI requirement.
- AnalyzerSeverityNone (src/.editorconfig)
- AnalyzerSeverityNone (src/.editorconfig)
- AnalyzerSeverityNone (src/.editorconfig)
- AnalyzerSeverityNone (src/.editorconfig)
- AnalyzerSeverityNone (src/.editorconfig)
- CRAP 110: JsonConfigurationFileParser.VisitValue (src/Infrastructures/Consul/Configuration/JsonConfigurationFileParser.cs)
- CRAP 113: DefaultCachingProvider.BaseGet (src/Infrastructures/Redis.Caching/Provider/DefaultCachingProvider.cs)
- CRAP 132: CachingAsyncInterceptor.InternalInterceptAsynchronous (src/Infrastructures/Redis.Caching/Core/Interceptor/Castle/CachingAsyncInterceptor.cs)
- CRAP 132: CachingAsyncInterceptor.InternalInterceptSynchronous (src/Infrastructures/Redis.Caching/Core/Interceptor/Castle/CachingAsyncInterceptor.cs)
- CRAP 132: DefaultCachingProvider.BaseGetAsync (src/Infrastructures/Redis.Caching/Provider/DefaultCachingProvider.Async.cs)
- CRAP 210: DataTimeExtension.GetDateFormat (src/Infrastructures/Core/Extensions/DateTime/DataTimeExtension.cs)
- CRAP 240: DataTimeExtension.GetDaysOfMonth (src/Infrastructures/Core/Extensions/DateTime/DataTimeExtension.cs)
- CRAP 240: DataTimeExtension.GetDaysOfMonth (src/Infrastructures/Core/Extensions/DateTime/DataTimeExtension.cs)
- Change coupling: BaseRabbitMqConsumer.cs ↔ RabbitMqProducer.cs (src/Infrastructures/EventBus/RabbitMq/BaseRabbitMqConsumer.cs)
- Change coupling: ConsulDiscoverDelegatingHandler.cs ↔ ServiceCollectionExtension.cs (src/Infrastructures/Consul/Discover/Handler/ConsulDiscoverDelegatingHandler.cs)
- Change coupling: HostExtension.cs ↔ WebApplicationBuilderExtension.cs (src/ServiceShared/WebApi/Extensions/HostExtension.cs)
- Change coupling: JwtTokenHelper.cs ↔ AbstractWebApiDependencyRegistrar.cs (src/ServiceShared/WebApi/Authentication/Bearer/JwtTokenHelper.cs)
- Change coupling: LogConsumersHostedService.cs ↔ OperateLogAsyncInterceptor.cs (src/ServiceShared/Application/Channels/LogConsumersHostedService.cs)
- Change coupling: PermissionRemoteHandler.cs ↔ AbstractWebApiDependencyRegistrar.cs (src/ServiceShared/WebApi/Authorization/Handlers/PermissionRemoteHandler.cs)
- …and 322 more
API surface
- Unchanged — 1 HTTP endpoints
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
AlphaYu/adnc 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 58c015a414432badba9fc33dd0ffd61753235303 — 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.