Proof & getting started · No. 39
Scaffold a .NET modular monolith in one command, then build your first module

One command writes the solution. The seven steps after it are the ones worth understanding, because they are what makes the generated code safe to change.
Most "add a feature" guides skip the parts that actually keep a codebase honest a year later. They show you a controller and a service class and call it a vertical slice. Then the aggregate has a public setter, the handler opens its own transaction by hand, validation lives in three places, and nobody can say which module owns which table.
MMCA.Common has opinions about all of that, and they are enforced opinions: a domain aggregate with no public constructor, a use case that is a thin handler wrapped by a fat decorator pipeline, and a module that declares its own dependencies so the host can assemble everything in the right order.
The framework ships a dotnet new pack, so you type none of that plumbing (ADR-065). Hand-rolling it
costs a day before you write a line of business logic, and ADR-065 measures that starting cost against
the framework's reference app: 12 projects, 178 files, and 15,128 lines of plumbing, an 803-line
.editorconfig and the 101-line Directory.Packages.props that carries every package pin among
them, several of those lines load-bearing in ways nothing tells you about until much later.
That changes what a tutorial like this is for. Step 0 gets you a green solution in a few minutes.
Steps 1 through 7 are the reasoning behind code you already have, which is what you need before you
change it. The example is a Coupon aggregate in a Promotions module, but every step maps directly
onto the real Conference, Sales, and Catalog modules in the consumer apps.
Prerequisites
- .NET 10 SDK. The framework multi-targets
net10.0andnet11.0; the generated app targetsnet10.0withLangVersion: previewfor C# extension types. - Familiarity with the layer flow: API -> Infrastructure -> Application -> Domain -> Shared. Your module's code lives in those layers, and the framework forbids inward layers from referencing outward ones (a topic for the fitness-test tutorial).
- The conventions in your head: factory methods return
Result<T>instead of throwing; commands and queries are separate; private fields are_camelCase;TreatWarningsAsErrorsis on.
No credentials and no private feed: the packages are on nuget.org.
The example types below are representative of the module shape, not copied verbatim from a specific
file. They use the documented base classes and markers, with two simplifications kept for
readability: Step 1 checks its invariants inline, where the framework's modules compose static
invariant classes with Result.Combine, and Step 2 names its event after the action, where the
framework convention is one {Aggregate}Changed event per aggregate carrying the entity state.
Step 0: scaffold the solution
dotnet new install MMCA.Templates
dotnet new mmca-app -n Contoso.Support --module Orders --aggregate Order
cd Contoso.Support
dotnet build Contoso.Support.slnx # warning-free under all five analyzers
dotnet test --solution Contoso.Support.slnx # passing, fitness rules included, no database
Three names, all independent: the solution (also your root namespace), the first module in plural PascalCase, and its aggregate root in singular PascalCase. Everything derived from them follows, from the routes and the identifier alias to the cache-key prefix and the Blazor pages.
You get twelve projects in the default shape: five module layers, a REST API host, a Blazor Server and
MudBlazor UI host, an Aspire AppHost (--no-aspire leaves it out), a per-database migrations project,
and three test projects. The aggregate arrives fully worked, in the same shape the rest of this article
explains.
Get that green before you change anything. It is the line you bisect against later, and if it is
not green that is a template bug rather than yours: the pack is generated from the framework's runnable
reference app, and a template-smoke CI job generates three solutions from it (two module shapes and
one SQLite solution without an AppHost) and builds and tests each in package mode.
One thing the scaffold deliberately does not hand over, because a rename or a shape flag invalidates
it and no fixed value is right for every name you could pick: declaration order, plus one
constructor shape. Two analyzer rules, and only two, ship dropped to suggestion in a marked
block appended to the staged .editorconfig; every other analyzer stays at error. SA1210 cannot
sort your namespace against MMCA.Common.* without knowing your name: an app namespace sorts above it
for Contoso.Support and below it for Zeta.App, so no checked-in order survives both. (SA1211,
alias order, stays at error: each module's identifier-alias file declares exactly one alias, so there
is no order for a rename to break.) IDE0021 is the shape flags rather than the renames: the
aggregate's private constructor assigns one property per optional axis, so
--no-status --no-description --no-owner together leave it with a single statement, which the
baseline then wants as an expression body. The generated README carries the exact commands (one
dotnet format analyzers run restores the ordering rule, SA1210; IDE0021 is not fixable that
way, so you fold the constructor by hand and delete the line). Every
mmca-command and mmca-query slice you scaffold later arrives with the same ordering skew, so either
re-run that format command after each scaffold or keep the delta until you stop scaffolding, then
delete it.
Your integration-event wire contract is not on that list: it arrives already frozen. The generated
IntegrationEventContractTests holds your own event, under the names you scaffolded with, and passes
on the first run. When you add or reshape an event on purpose, you version it and update
ExpectedContract in the same commit.
Now the part worth reading.
Step 1: define the aggregate with a private constructor and a Result factory
Open the Domain layer of the module you just generated (Source/Modules/Orders/...Orders.Domain/), or
start a fresh one there. An aggregate root inherits from AuditableAggregateRootEntity<TId>, the top
rung of the framework's three-rung entity chain:
BaseEntity<TId> -> AuditableBaseEntity<TId> -> AuditableAggregateRootEntity<TId>
BaseEntity<TId> gives you a required init identifier (set once at construction, immutable after,
while EF still materializes through the parameterless constructor). AuditableBaseEntity<TId> adds the
audit fields (CreatedOn/By, LastModifiedOn/By, and DeletedOn/By for a soft delete), stamped
automatically at save; the soft-delete IsDeleted flag, which the entity's own Delete() method sets;
and a RowVersion concurrency token. AuditableAggregateRootEntity<TId> adds the domain-event
collection and aggregate helpers.
The load-bearing idiom is the private constructor plus static Create factory returning
Result<T>. You cannot new an invalid aggregate into existence; the factory is the only door, and
it enforces the invariants:
// Domain layer (representative)
public sealed class Coupon : AuditableAggregateRootEntity<CouponIdentifierType>
{
public string Code { get; private set; }
public decimal PercentOff { get; private set; }
public bool IsActive { get; private set; }
private Coupon() { } // EF materializes through this; callers cannot use it
public static Result<Coupon> Create(string code, decimal percentOff)
{
if (string.IsNullOrWhiteSpace(code))
{
return Result.Failure<Coupon>(CouponErrors.CodeRequired);
}
if (percentOff is <= 0 or > 100)
{
return Result.Failure<Coupon>(CouponErrors.PercentOutOfRange);
}
var coupon = new Coupon
{
Id = default, // DB-generated identity; the factory leaves it
Code = code.Trim(),
PercentOff = percentOff,
IsActive = true,
};
return Result.Success(coupon);
}
}
Two things to notice. The setters are private so state changes only through methods on the aggregate.
And the factory returns Result<Coupon>, never throws, so a caller handles an invalid coupon as a value,
not an exception. This is the SOLID-and-DDD story in miniature: the factory is the single place
invariants live.
Step 2: raise a domain event with AddDomainEvent
State changes that other parts of the system care about are announced as domain events. You do not publish them directly; you record them on the aggregate, and the framework turns them into durable outbox rows in the same transaction that saves the data.
Add a business method that mutates state and records the event:
// On the Coupon aggregate (representative)
public Result Deactivate()
{
if (!IsActive)
{
return Result.Failure(CouponErrors.AlreadyInactive);
}
IsActive = false;
AddDomainEvent(new CouponDeactivated(Id, Code));
return Result.Success();
}
The sequence is always: the aggregate mutates its own state, then calls AddDomainEvent(...), and the
event sits in the aggregate's collection until SaveChanges runs. At save time the framework stamps the
audit fields, captures the domain events, serializes them to OutboxMessage rows, commits data and
outbox in one transaction, then dispatches in-process and marks the rows processed. You write one line;
the durability comes for free. A domain event like this one stays inside the process; only an
integration event (IIntegrationEvent) is left on the outbox for OutboxProcessor to publish through
IMessageBus, in-process in the monolith and over a broker once a module is extracted (the
transactional-outbox article covers that machine in full).
AddDomainEvent lives on AuditableAggregateRootEntity<TId>, so any aggregate can raise events, and
nothing in the Domain layer knows or cares how they will eventually be delivered.
Step 3: write the command and its handler
A write is a use case: a small command object handed to a handler that does exactly one thing. The
handler implements ICommandHandler<TCommand, TResult>, which is a single method,
Task<TResult> HandleAsync(TCommand, CancellationToken), returning Result or Result<T>.
Keep the handler thin. It creates or loads the aggregate, calls a business method, stages the change in a repository it gets from the unit of work, and saves. Everything cross-cutting (logging, caching, transactions) is added by the pipeline, not by the handler.
// Application layer (representative)
// The command is a plain record; the result type is declared on the handler below.
public sealed record CreateCouponCommand(string Code, decimal PercentOff)
: ITransactional; // ITransactional opts into a DB transaction
public sealed class CreateCouponHandler(IUnitOfWork unitOfWork)
: ICommandHandler<CreateCouponCommand, Result<CouponIdentifierType>>
{
public async Task<Result<CouponIdentifierType>> HandleAsync(
CreateCouponCommand command, CancellationToken cancellationToken)
{
var couponResult = Coupon.Create(command.Code, command.PercentOff);
if (!couponResult.TryGetValue(out var coupon))
{
return Result.Failure<CouponIdentifierType>(couponResult.Errors);
}
var repository = unitOfWork.GetRepository<Coupon, CouponIdentifierType>();
await repository.AddAsync(coupon, cancellationToken); // stages; never flushes
await unitOfWork.SaveChangesAsync(cancellationToken); // writes, and fills the DB-generated Id
return Result.Success(coupon.Id);
}
}
TryGetValue is the framework's preferred read of a Result<T>: the compiler tracks the check, so
coupon needs no !, where reading Value (a T?) would raise a nullable warning, which
TreatWarningsAsErrors turns into a build break. The repository only stages changes; persisting is the
unit of work's job, which is why the framework's own create path is the same AddAsync then
SaveChangesAsync pair.
The marker interface ITransactional is the whole transaction opt-in. It is an empty interface; the
type is the message. When the command implements it, the TransactionalCommandDecorator wraps the
handler in IUnitOfWork.ExecuteInTransactionAsync and rolls back on an exception. The commit does not
save the handler's work, so the handler still calls SaveChangesAsync before it returns: a change
still tracked at commit throws an InvalidOperationException and rolls the unit back rather than being
silently discarded. A handler that does
not need a transaction (a single SaveChanges whose atomicity the outbox already guarantees) simply
does not implement the marker. There is a sibling marker, ICacheInvalidating, that exposes a
CachePrefix to evict on success the same way.
Step 4: add a FluentValidation validator
Input validation does not belong in the handler. Write a FluentValidation validator for the command,
and the pipeline runs it automatically before the handler ever executes:
// Application layer (representative)
public sealed class CreateCouponCommandValidator : AbstractValidator<CreateCouponCommand>
{
public CreateCouponCommandValidator()
{
RuleFor(c => c.Code).NotEmpty().MaximumLength(32);
RuleFor(c => c.PercentOff).InclusiveBetween(0.01m, 100m);
}
}
This is structural validation (shape, length, range). It complements the domain factory's invariant
checks rather than replacing them: the validator rejects obviously malformed input cheaply at the edge,
and Coupon.Create still enforces the business rules that must hold no matter how the call arrived. The
validator is auto-discovered by convention scanning in the next step, so you do not register it by hand.
Step 5: implement IModule
A module is the unit of cohesion above a feature slice. It implements IModule: a display Name,
an optional Dependencies list of other module names, a RequiresDependencies flag, and a single
Register(services, configuration, applicationSettings) method that wires all of the module's services.
The interface ships default-implemented members (Dependencies => [], RequiresDependencies => false,
an empty RegisterDisabledStubs), so a minimal module implements only Name and Register:
// API layer (representative): the module's entry point
public sealed class PromotionsModule : IModule
{
public string Name => "Promotions";
// This module reads coupon usage from Sales, so declare the dependency.
public IReadOnlyList<string> Dependencies => ["Sales"];
public void Register(
IServiceCollection services,
IConfigurationBuilder configuration,
ApplicationSettings applicationSettings)
{
// Handlers, validators, and mappers are picked up by the Application layer's
// convention scan (next step). The Infrastructure call registers no service: it
// is what makes the host load the assembly whose EF configurations are discovered.
services.AddModulePromotionsApplication();
services.AddModulePromotionsInfrastructure();
}
}
The class lives in the module's API project, the one layer that references both Application and
Infrastructure, so it is the natural place to compose them. The API layer registers nothing of its
own (MVC discovers its controllers), so there is no third call. The generated module keeps Register
to a single line that delegates to an Add{Module}Module extension making those two calls.
Dependencies is what lets the framework do something genuinely useful: ModuleLoader discovers every
IModule in the assemblies the host names and registers them in topological order (Kahn's
algorithm) based on declared dependencies, so a module is always wired after the modules it depends on.
ModulesSettings (the "Modules" config section) can disable a module; disabled modules receive stub
registrations so cross-module interfaces stay resolvable. That last detail is the extraction boundary: a
module that depends on a now-remote module keeps compiling and resolving because the stub stands in
until a gRPC client takes over.
Step 6: register in the exact DI sequence
This is the step the most experienced developers still get wrong, because one ordering rule is
load-bearing. AddApplicationDecorators() must run after every module's handler scan, because Scrutor's
TryDecorate can only wrap handlers that are already registered. That is the only constraint that
matters here. Registrations that are not handlers (infrastructure, API, telemetry, options) can sit on
either side of it: DI dependencies resolve at runtime, not at registration time, so the infrastructure
that backs the decorated handlers can be registered before or after them. The generated host composes
the handler registrations inside AddMmcaApplicationPipeline, which runs AddApplication() first and
AddApplicationDecorators() last, and keeps everything else outside the call:
// Host composition root: the generated Web/Program.cs, abridged (representative module names)
services.AddCommonExceptionHandlers(); // ProblemDetails exception handlers
services.AddInfrastructure(builder.Configuration); // repos, UoW, DbContexts, caching, outbox
services.AddStronglyTypedIds(identifierAssemblies); // one Shared assembly per module (ADR-115)
// ...the opt-ins (AddAuditTrail, AddScheduledJobs, AddMultiTenancy, AddWebhooks) sit here
services.AddAPI(modulesSettings); // controllers, idempotency, feature flags, error localization
services.AddErrorResources<OrdersErrorResources>(); // one per module: error-code translations
services.AddErrorResources<PromotionsErrorResources>();
services.AddMmcaApplicationPipeline(pipeline => pipeline // AddApplication() first, decorators LAST, then sealed
.Register(s => moduleLoader.DiscoverAndRegister(
s, builder.Configuration, applicationSettings, modulesSettings,
builder.Environment.EnvironmentName,
[typeof(OrdersModule).Assembly, typeof(PromotionsModule).Assembly])) // each module scans itself
.Register(s => s.AddBrokerMessaging(builder.Configuration))
.AddWebhookDelivery()); // the decorated webhook delivery handler
services.AddModuleHealthChecks(moduleLoader); // not a handler registration: stays outside
The rules embedded in that order:
ScanModuleApplicationServices<TMarker>()runs once per module, from inside that module's own registration, whichModuleLoaderreaches through the module'sRegister. It auto-registers that module's domain-event and integration-event handlers (singleton), DTO and request mappers, DTO projectors and update appliers (scoped), command and query handlers (scoped), and FluentValidation validators. This is why you did not register the validator from Step 4 or the handler from Step 3 by hand: convention scanning found them by the marker type's assembly.AddApplicationDecorators()must be last of the Application registrations. It uses Scrutor'sTryDecorateto wrap every already-registered handler, then seals the pipeline. A module scan that runs after the seal throws anInvalidOperationExceptionnaming the call, so a misplaced scan fails at startup instead of running undecorated. A handler registered by hand after the seal is the one case that still slips through: it runs with no transactions, no caching, no logging, and no error to tell you.AddMmcaApplicationPipeline(pipeline => ...)is the framework's preferred form of the same sequence and the one the generated host uses: it runsAddApplication(), then your callback's steps in order (module discovery, then broker wiring, so the broker'sReplacecalls win over the loader's, then the outbound webhook delivery handler, so the decorators wrap it like every other command handler), thenAddApplicationDecorators(), so the handler registrations cannot land on the wrong side of the decorators.
Step 7: watch the decorator pipeline kick in, for free
With the sequence correct, every command and query handler is now wrapped, in this execution order:
Commands: ViewAs -> FeatureGate -> Authorization -> Logging -> Caching -> Validating -> Timeout -> Transactional -> Handler
Queries: FeatureGate -> Authorization -> Logging -> Caching -> Validating -> Timeout -> Handler
You wrote a thin handler. The pipeline added the rest, driven by the marker interfaces:
- ViewAs is outermost for commands, and commands only: it refuses every command while the caller holds a view-as token, so a staff user viewing the app as another user can read but never write in that user's name (ADR-137). For an ordinary caller it passes straight through.
- FeatureGate comes next for commands and is outermost for queries. It short-circuits the call when the feature flag for that command or query is turned off.
- Authorization comes next, and sits outside caching on purpose. Commands and queries that
implement
IRequiresPermissionare checked against the permission registry for the current user's roles (and those that implementIRequiresMfaagainst themfaclaim), and a denial short-circuits with aForbiddenerror, so a denied query never reads from or populates the cache. - Logging logs every command and query that passed the gates outside it, with its duration and
the correlation id it reads from
ICorrelationContext, with no per-handler code. It times only what runs inside it (Caching down to the handler), so ViewAs, FeatureGate and Authorization fall outside the recorded duration. - Caching runs for queries that implement
IQueryCacheable(supplyingCacheKey+CacheDuration), and invalidates for commands that implementICacheInvalidating(on success, outside the transaction boundary). - Validating runs FluentValidation on both sides. On a command it runs before the transaction opens. On a query it sits inside Caching by design, because a cached entry was already validated when it was produced, so a cache hit skips the validator along with the handler.
- Timeout gives commands and queries that implement
IHasTimeouttheir own execution budget: the handler runs under a linked token cancelled when the budget expires, and expiry comes back as aRequest.TimedOutfailure rather than an exception, while caller cancellation still propagates as one. A budget of zero or less passes straight through. - Transactional opens a DB transaction only when the command implements
ITransactional, and rolls back on an exception. A business failure (Result.Failure) also rolls the transaction back:ExecuteInTransactionAsyncinspects the returned value and, onResult { IsFailure: true }, callsRollbackTransaction()and skips the commit, choosing atomicity over partial persistence. Cache invalidation runs only on success, so a failed command evicts nothing either way.
Your CreateCouponCommand from Step 3 implemented ITransactional, so it now runs inside a transaction
automatically. You never wrote BeginTransaction. That is the payoff of the shape: the handler stays
about the use case, and the cross-cutting concerns are written once, in the framework, and reused by
every handler in every module.
The next slice, and the next module
You will repeat that shape for every feature you add, so the pack scaffolds it too, which keeps it from
drifting one hand-typed slice at a time. A single vertical slice is one command, run from the module's
UseCases folder:
dotnet new mmca-command -n CancelOrder --app Contoso.Support --module Orders `
--aggregate Order --domain-method Cancel
dotnet new mmca-query -n GetOrderByNumber --app Contoso.Support --module Orders `
--aggregate Order
Handlers are convention-scanned, so there is nothing to register. Three things still need you: add the
--domain-method guarded method to your aggregate before the command slice compiles, map each slice
in your module's controller (a write injects its handler directly; reads usually come from
EntityControllerBase, so a new query needs its own action), and keep the query's CacheKey inside
your module's *CacheKeys.Prefix. The caching decorator matches cacheable reads to invalidating
commands by string prefix, so a key that drifts out of it goes stale silently.
A whole second module, across all five layers plus its test and migrations projects, is one command
from the root of a solution mmca-app generated:
pwsh build/add-module.ps1 -Name Billing -Aggregate Invoice
Here is the boundary where generated code stops and you start. dotnet new cannot patch files that
already exist, so the mmca-module template on its own prints seven numbered wire-ups it cannot
perform, and until they are done the module is invisible to the host and to the fitness rules. The
script is why an mmca-app solution types none of them: it invokes the template, then performs all
seven itself, plus the first migration and one edit the list does not name: it appends the new
module's event to the frozen ExpectedContract, so your next test run stays green. Run the template
first by mistake and its printed text opens by telling you to undo that run (delete
Source/Modules/<Module>, Tests/Modules/<Module> and the module's migrations project) and use the
script instead, because the script refuses a name that already exists under Source/Modules. Two
things the script leaves to you: the Blazor UI pages (the UI host still shows only the first module)
and the new module's page-level localization resources.
On a hand-built solution the template is the path:
dotnet new mmca-module -n Billing --app Contoso.Support --aggregate Invoice
Its printed list is the fallback for that solution, and the best description of what the script is doing on your behalf:
- Solution. Add the eight new projects (five layer projects, both test projects, and the
migrations project) to the
.slnx. - Project references. The Web host needs the module's API project and its migrations project. The architecture-test project needs all five layer projects, because the map in step 4 names a type from each.
- Identifier alias. Copy the existing
<Compile Include ... Link>block inDirectory.Build.propsand point it at the new module's*.GlobalUsings.IdentifierType.cs. Without it the alias is invisible outside its own project. - Architecture map. Five lines in your
*ArchitectureMap.cs, one per layer. A module missing from the map is silently not covered by the layering and isolation rules. No error, no warning: the rules simply stop watching the code you just added. - Host. Three edits in the Web host's
Program.cs. Addtypeof(BillingModule).Assemblyto the list handed toModuleLoader.DiscoverAndRegister: discovery scans only the assemblies the host names, so a module left out of that list registers nothing. Then add oneservices.AddErrorResources<BillingErrorResources>();next to the existing ones. Last, add the module's Shared assembly to the list handed toAddStronglyTypedIds: the generated child identifier is a strongly typed wrapper, so without it EF has no converter for its key and a route cannot bind it. - Database. The module gets its own: an
AddDatabase/WithSQLServerDataSourcepair in the AppHost,Modules/DataSources/Outboxentries in the Web host'sappsettings.json, and the deletion of the now-conflicting top-levelSQLServerMigrationsAssembly. Every module database carries its own outbox and inbox tables, so two modules migrated into one database collide on them. The order of the AppHost data-source calls is cosmetic (theDefaultsource is decided by the top-levelConnectionStrings__override on the first module), and naming the outbox source explicitly is what stops it from moving to another module's database the day that connection changes. - First migration.
dotnet ef migrations add InitialCreateagainst the new migrations project.
The first two are what make it compile, so they fail loudly. Numbers three and four do not, and neither does the module-assembly half of number five, which is why they are worth reading twice. And the honest reading of the script is not that the wire-ups stopped mattering: it is that the one code path CI exercises applies them for you, on a solution the template generated.
Trade-offs and gotchas, honestly
The shape buys consistency, and it asks for discipline in return:
- The DI order is guarded, but not completely.
AddApplicationDecorators()seals the pipeline, so a module scan placed after it throws at startup. A handler registered by hand after it still runs undecorated with no warning. The generated solution shipsDecoratorPipelineOrderTests, which builds the module's registration sequence, asserts the decorator nesting for one command and one query, and runs the framework'sVerifyDecoratorPipeline()over the module's whole handler set, so no handler the module registers escapes the pipeline. It runs the module's own registration rather than the host'sProgram.cs, so a handler the host registers by hand after the seal is still silent (the next article covers fitness tests). - Markers are easy to forget.
ITransactionalandICacheInvalidatingare opt-in by presence. Forget the marker and you lose the behavior silently. The upside (no behavior you did not ask for) is also the trap (no behavior you forgot to ask for). - Validation lives in two places by design. Cheap structural checks in the FluentValidation validator, business invariants in the domain factory. That is intentional layering, not duplication, but it does mean a rule can be enforced at the wrong altitude if you are not deliberate.
- Topological ordering depends on accurate
Dependencies. If a module reads from another but does not declare it, the loader may wire it too early. Declare every cross-module dependency you actually take. - Soft-delete is the default. Your aggregate is never hard-deleted;
IsDeletedis set and global query filters hide it. Plan for the data to persist, which matters for both storage and privacy. - A scaffold is a starting point, not an understanding. The generated solution is green on day one, which is exactly what makes it easy to change something load-bearing without noticing. The marker interfaces, the architecture map, and the host's list of module assemblies are the places where a wrong edit fails silently rather than loudly.
None of these are reasons to fight the shape. They are the reasons to learn it once and let it carry every module after.
What we covered: scaffolding the whole solution with dotnet new mmca-app and the one fixup it
deliberately leaves you, the aggregate with a private constructor and a Result factory, raising a
domain event with AddDomainEvent, a thin command handler marked ITransactional, a FluentValidation
validator, the IModule contract with Name and Dependencies, the DI sequence (each module's
ScanModuleApplicationServices<T>() reached through ModuleLoader.DiscoverAndRegister, then
AddApplicationDecorators() last, sealing the pipeline), the decorator pipeline that wraps every
handler automatically, and the seven wire-ups mmca-module prints because dotnet new cannot patch
files that already exist (a solution generated by mmca-app applies all seven for you through its own
build/add-module.ps1).
Next in the series: write your first architecture fitness test, so the conventions in this article become a red build instead of a code-review comment.
MMCA.Common is Apache-2.0 licensed and open source. Star the repo, read ADR-065 on why the template is generated from the reference app rather than maintained beside it, or scaffold a solution and tell me what breaks.
- Repo: https://github.com/ivanball/MMCA.Common
- Templates guide: https://ivanball.github.io/docs/guides/common-TEMPLATES.html
- Getting started: https://ivanball.github.io/docs/guides/common-GETTING-STARTED.html
Tags: .NET, C Sharp, Domain Driven Design, CQRS, Software Architecture