UpdaterAgent follows Clean Architecture with a strict inward-only dependency rule: outer layers call inner layers, and inner layers never reference anything outside themselves. This keeps domain logic free of infrastructure concerns, makes services independently testable, and lets external integrations be swapped without touching business rules.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ShohjahonSohibov/repo-for-agent/llms.txt
Use this file to discover all available pages before exploring further.
Dependency flow
Dependencies flow in one direction only:- Api depends on Application
- Application depends on Infrastructure and Domain
- Infrastructure depends on Domain
- Domain has zero project dependencies
The Domain layer is the innermost ring and must never import from Application, Infrastructure, or Api. Any violation breaks the architecture’s testability guarantee.
Layer responsibilities
| Layer | Project | Purpose | Key components |
|---|---|---|---|
| Api | UpdaterAgent.Api | HTTP handling, routing, auth enforcement, response formatting | Controllers, filters, SignalR hubs, middleware pipeline |
| Application | UpdaterAgent.Application | Business logic, orchestration, background jobs | Feature services, Hangfire jobs, DTOs, Dependencies.cs |
| Infrastructure | UpdaterAgent.Infrastructure | Database access, external API brokers, file I/O | AppDbContext, EF Core migrations, broker implementations |
| Domain | UpdaterAgent.Domain | Core entities, enums, value objects, result abstractions | Entity classes, ModelBase<TId>, AuditableModelBase<TId>, ITenantEntity |
Service file convention
Every feature module in the Application layer follows a four-file layout:FeatureService.cs (public methods) and FeatureService.Internals.cs (private helpers) using C# partial classes. This keeps individual files focused without splitting the service into multiple classes.
Result pattern
Services returnResult<T> instead of throwing exceptions for expected business failures. This makes error paths explicit and avoids hidden control flow.
Result and Error are defined in UpdaterAgent.Domain/Abstractions/. Domain-specific errors are grouped by entity:
Throw exceptions only for truly exceptional, unrecoverable conditions — not for expected business failures like “not found” or “invalid input”.
Entity base classes
| Class | Properties added | When to use |
|---|---|---|
ModelBase<TId> | Id, IsDeleted | Simple entities without audit tracking |
AuditableModelBase<TId> | + CreatedAt, UpdatedAt, CreatedBy, UpdatedBy | Most domain entities |
ITenantEntity | TenantId (long) | Every entity that belongs to a tenant |
AuditableModelBase<long>, implement ITenantEntity, and add [Index(nameof(TenantId))] for query performance.
Dependency injection registration
Application services registered in Dependencies.cs
Open
src/UpdaterAgent.Application/Dependencies.cs and call ConfigureApplicationServices(). All application services are registered as Scoped unless they are stateless singletons.Infrastructure services registered in Dependencies.cs
Open
src/UpdaterAgent.Infrastructure/Dependencies.cs and call ConfigureInfrastructureServices(). Register AppDbContext, brokers, and infrastructure helpers here.