|
| 1 | +# UMS API .NET Applied Reference |
| 2 | + |
| 3 | +> Language: [English](./ums-api-dotnet-applied-reference.md) | [Espanol](./ums-api-dotnet-applied-reference.es.md) |
| 4 | +
|
| 5 | +## 1. Purpose |
| 6 | + |
| 7 | +This document maps the UMS .NET API implementation to the Evolith API Standard - .NET. It is an applied product reference, not a universal standard. |
| 8 | + |
| 9 | +Reusable backend rules belong in Evolith. UMS-specific details remain here unless promoted through an Evolith ADR, governance standard, or canonical pattern. |
| 10 | + |
| 11 | +## 2. Source scope |
| 12 | + |
| 13 | +The applied reference covers: |
| 14 | + |
| 15 | +```text |
| 16 | +src/apps/ums.api |
| 17 | +``` |
| 18 | + |
| 19 | +Observed profile: |
| 20 | + |
| 21 | +| Concern | UMS implementation | |
| 22 | +|---|---| |
| 23 | +| Host | ASP.NET Core minimal host | |
| 24 | +| Composition | Presentation bootstrappers | |
| 25 | +| Application boundary | MediatR and FluentValidation | |
| 26 | +| API surface | REST commands and GraphQL queries | |
| 27 | +| Versioning | URL segment API versioning | |
| 28 | +| Persistence | EF Core with SQL Server baseline and local SQLite support | |
| 29 | +| Operations | Structured logs, telemetry registration, health checks, rate limits, background workers | |
| 30 | +| Cross-cutting policies | Aspects for audit, transactions, tenant validation, and logging | |
| 31 | + |
| 32 | +## 3. Mapping |
| 33 | + |
| 34 | +| Evolith topic | UMS source evidence | Classification | |
| 35 | +|---|---|---| |
| 36 | +| Host bootstrap | `Ums.Presentation/Program.cs` | Applied evidence | |
| 37 | +| Modular service composition | `Ums.Presentation/Bootstrapping/UmsApiServiceBootstrappers.cs` | Reusable pattern | |
| 38 | +| Application boundary | `Ums.Application/DependencyInjection.cs` | Reusable pattern | |
| 39 | +| Middleware pipeline | `UseUmsApiPipeline` | Applied evidence | |
| 40 | +| API surface mapping | `MapUmsApiSurface` and bounded-context route groups | Applied evidence; concrete modules local | |
| 41 | +| GraphQL query surface | `MapGraphQlSurface` | Candidate Evolith governance standard | |
| 42 | +| Health model | `MapHealthSurface` and infrastructure health checks | Reusable operations pattern | |
| 43 | +| Persistence provider setup | `Ums.Infrastructure/DependencyInjection.cs` | Pattern reusable; provider matrix local | |
| 44 | +| SQL Server EF Core profile | DbContext setup, retries, interceptors, migration history table | Candidate Evolith persistence profile | |
| 45 | +| Background workers | Audit persistence and outbox dispatcher hosted services | Reusable reliability pattern | |
| 46 | +| Cross-cutting aspects | AOP setup and MediatR proxy registration | Candidate canonical pattern | |
| 47 | + |
| 48 | +## 4. Items that should remain UMS-local |
| 49 | + |
| 50 | +| Item | Reason | |
| 51 | +|---|---| |
| 52 | +| Bounded contexts and aggregate modules | Product domain model. | |
| 53 | +| Concrete endpoint groups and route names | UMS API surface. | |
| 54 | +| Product documentation metadata | UMS product identity. | |
| 55 | +| Concrete header and claim names | Local API contract. | |
| 56 | +| Development-only helpers | Local development support. | |
| 57 | +| Runtime values for limits and retries | Product operations policy. | |
| 58 | +| Schema names and repository class names | UMS persistence implementation. | |
| 59 | +| Product-specific strategy classes | UMS capability implementation. | |
| 60 | +| Development seed data | Local environment behavior. | |
| 61 | + |
| 62 | +## 5. Items to promote to Evolith |
| 63 | + |
| 64 | +| Candidate | Promotion target | |
| 65 | +|---|---| |
| 66 | +| Minimal host plus named bootstrapper composition | Evolith API bootstrap standard | |
| 67 | +| REST commands plus GraphQL query governance | Evolith API surface standard or ADR | |
| 68 | +| MediatR plus validation pipeline | Evolith application-layer profile | |
| 69 | +| Problem Details and user-safe error context | Evolith API error standard | |
| 70 | +| SQL Server EF Core profile | Evolith persistence standard | |
| 71 | +| Request and execution context abstractions | Evolith tenancy and observability standard | |
| 72 | +| Liveness, readiness, and backlog health model | Evolith operations standard | |
| 73 | +| Outbox and audit background processing | Evolith reliability standard | |
| 74 | +| Aspect or decorator based cross-cutting policies | Evolith canonical pattern or ADR | |
| 75 | + |
| 76 | +## 6. Items requiring ADR or formal promotion |
| 77 | + |
| 78 | +| Item | Required action | |
| 79 | +|---|---| |
| 80 | +| .NET 10 backend runtime baseline | Evolith ADR or authoritative stack update | |
| 81 | +| REST commands and GraphQL queries in one API tier | Evolith API governance ADR | |
| 82 | +| MediatR as default application boundary | Evolith ADR or optional backend profile | |
| 83 | +| FluentValidation as validation pipeline standard | Evolith engineering standard | |
| 84 | +| EF Core plus SQL Server as default persistence profile | Evolith persistence ADR or stack standard | |
| 85 | +| AOP shell library as cross-cutting implementation mechanism | Evolith canonical pattern and ADR | |
| 86 | +| Retry and circuit breaker profile for persistence | Evolith resilience standard | |
| 87 | +| Idempotency requirement for commands | Evolith API reliability standard | |
| 88 | + |
| 89 | +## 7. Validation checklist |
| 90 | + |
| 91 | +Before changing UMS API architecture, validate: |
| 92 | + |
| 93 | +- Classify the change as Evolith standard, UMS local decision, or promotion candidate. |
| 94 | +- Keep shared backend patterns independent from UMS product language. |
| 95 | +- Keep product routes, headers, seed data, schemas, and strategy classes in UMS. |
| 96 | +- Propose reusable rules in Evolith first. |
| 97 | +- Update English and Spanish documentation together. |
| 98 | +- Keep Markdown UTF-8 clean and free from decorative icons. |
| 99 | +- Do not modify workflows or hooks without explicit authorization. |
| 100 | + |
| 101 | +--- |
| 102 | +[Back to API .NET Portal](./README.md) |
0 commit comments