🏗️ Chapter 4 is live: the P2P solution skeleton is on GitHub

I've pushed the first code milestone for my book Procure-to-Pay: Building an Enterprise Blazor Application with Clean Architecture, CQRS, Entity Framework Core and Radzen Blazor Components.

Chapter 4, "Creating the Solution", doesn't have much code, but it sets up the structure the rest of the application depends on.

What's in the repo right now:

:white_check_mark: A .NET 10 solution in the new .slnx format. It's plain XML that's easy to read and merges cleanly in Git.
:white_check_mark: Six projects: Domain, Contracts, Application, Infrastructure, Web (the host), and Web.Client (Blazor WebAssembly, Auto interactivity)
:white_check_mark: Three test projects: Domain, Application and Web
:white_check_mark: Directory.Build.props: nullable enabled, warnings treated as errors, latest analysers, all set once for every project
:white_check_mark: Directory.Packages.props: central package management, so an upgrade changes one line instead of ten .csproj files

The part I care about most: the dependency rule is enforced by the project references.

:small_blue_diamond: P2P.Domain references nothing.
:small_blue_diamond: P2P.Web.Client references only P2P.Contracts.
:small_blue_diamond: P2P.Web is the composition root, so it's the only project that sees everything.

Conventions don't hold up on their own. Under deadline pressure, someone will eventually add the forbidden reference, and it will still compile. So the repo includes ArchitectureTests that fail the build if:
:cross_mark: the Domain assembly references EF Core, ASP.NET Core, SqlClient, Radzen, FluentValidation or Newtonsoft.Json
:cross_mark: any domain entity has a public parameterless constructor (entities must be created through factory methods like Vendor.Create(...), so an entity can never exist in an invalid state)

One detail for anyone building financial apps: InvariantGlobalization is explicitly set to false. If it's left on, currency formatting quietly falls back to the invariant culture, and ₦, £ and € stop rendering correctly.

Next up is Chapter 5, the Domain Layer: entities, value objects and business rules.

:link: Repo: https://github.com/benjaminsqlserver/P2P
Clone it, run dotnet build and dotnet test, and follow along as the book progresses.

#dotnet #Blazor #CSharp #CleanArchitecture #CQRS #RadzenBlazor #EFCore #SQLServer #SoftwareArchitecture #ProcureToPay