Skip to content

Commit 5672f90

Browse files
authored
Merge branch 'main' into Localization
2 parents a4f3ce8 + dd71d99 commit 5672f90

File tree

24 files changed

+419
-106
lines changed

24 files changed

+419
-106
lines changed

.github/copilot-instructions.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ This is a **Clean Architecture template** for .NET 9 that demonstrates Domain-Dr
1414
- Always use {} for blocks except single-line exits (e.g. `return`, `throw`)
1515
- Always keep single line blocks on one line (e.g., `if (x) return y;`)
1616
- Prefer primary constructors for required dependencies
17+
- Never use primary constructor parameters directly - always assign to private fields for clarity and testability
1718

1819
### Core Dependencies Flow
1920
- **Core** ← UseCases ← Infrastructure
@@ -22,7 +23,7 @@ This is a **Clean Architecture template** for .NET 9 that demonstrates Domain-Dr
2223

2324
### Key Projects
2425
- **Core**: Domain entities, aggregates, value objects, specifications, interfaces
25-
- **UseCases**: Commands/queries (CQRS), MediatR handlers, application logic
26+
- **UseCases**: Commands/queries (CQRS), Mediator handlers, application logic
2627
- **Infrastructure**: EF Core, external services, email, file access
2728
- **Web**: FastEndpoints API, REPR pattern, validation
2829

@@ -44,7 +45,7 @@ This is a **Clean Architecture template** for .NET 9 that demonstrates Domain-Dr
4445
### Use Cases (CQRS)
4546
- Commands for mutations, Queries for reads
4647
- Queries can bypass repository pattern for performance
47-
- Use MediatR for command/query handling
48+
- Use Mediator (source generator) for command/query handling
4849
- Chain of responsibility for cross-cutting concerns (logging, validation)
4950

5051
### Validation Strategy
@@ -78,7 +79,7 @@ dotnet new clean-arch -o Your.ProjectName
7879

7980
### Primary Libraries
8081
- **FastEndpoints**: API endpoints (replaced Controllers/Minimal APIs)
81-
- **MediatR**: Command/query handling in UseCases
82+
- **Mediator**: Command/query handling in UseCases
8283
- **EF Core**: Data access (SQLite default, easily changed to SQL Server)
8384
- **Ardalis.Specification**: Repository query specifications
8485
- **Ardalis.Result**: Error handling pattern

MinimalClean.nuspec

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,25 @@
33
<metadata>
44
<id>Ardalis.MinimalClean.Template</id>
55
<title>ASP.NET Minimal Clean Architecture Solution</title>
6-
<version>1.0.0-beta1</version>
6+
<version>1.0.1</version>
77
<authors>Steve Smith</authors>
88
<description>
99
A simplified Clean Architecture template using vertical slice architecture in a single project.
1010
Perfect for MVPs, smaller applications, or teams wanting architectural guidance without multi-project complexity.
1111
Features Domain-Driven Design patterns, FastEndpoints, Entity Framework Core, and optional Aspire support.
12-
Built with .NET 10 and C# 13.
12+
Built with .NET 10 and C#.
1313
</description>
1414
<language>en-US</language>
1515
<license type="expression">MIT</license>
1616
<projectUrl>https://github.com/ardalis/CleanArchitecture</projectUrl>
1717
<releaseNotes>
1818
* Initial release of Minimal Clean Architecture template
1919
* Single-project vertical slice architecture
20-
* Built with .NET 10 and C# 13
20+
* Built with .NET 10 and C#.
2121
* FastEndpoints for REPR pattern
2222
* Pragmatic DDD with simplified patterns
23-
* Optional Aspire support
23+
* Aspire support
24+
* 1.0.1 fixes a minor bug
2425
</releaseNotes>
2526
<packageTypes>
2627
<packageType name="Template" />

MinimalClean/.gitignore

Lines changed: 243 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,243 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
4+
# User-specific files
5+
*.suo
6+
*.user
7+
*.userosscache
8+
*.sln.docstates
9+
10+
# Build results
11+
[Dd]ebug/
12+
[Dd]ebugPublic/
13+
[Rr]elease/
14+
[Rr]eleases/
15+
x64/
16+
x86/
17+
build/
18+
bld/
19+
[Bb]in/
20+
[Oo]bj/
21+
22+
# Visual Studio 2015/2017/2019/2022 cache/options directory
23+
.vs/
24+
.vscode/
25+
26+
# MSTest test Results
27+
[Tt]est[Rr]esult*/
28+
[Bb]uild[Ll]og.*
29+
30+
# NUnit
31+
*.VisualState.xml
32+
TestResult.xml
33+
nunit-*.xml
34+
35+
# Build Results of an ATL Project
36+
[Dd]ebugPS/
37+
[Rr]eleasePS/
38+
dlldata.c
39+
40+
# .NET Core
41+
project.lock.json
42+
project.fragment.lock.json
43+
artifacts/
44+
45+
# ASP.NET Scaffolding
46+
ScaffoldingReadMe.txt
47+
48+
# Database files
49+
*.db
50+
*.db-shm
51+
*.db-wal
52+
*.sqlite
53+
*.sqlite3
54+
55+
# Entity Framework Core migrations (keep migrations folder, ignore db files)
56+
**/Migrations/*.db
57+
58+
# User-specific files (MonoDevelop/Xamarin Studio)
59+
*.userprefs
60+
61+
# Windows image file caches
62+
Thumbs.db
63+
ehthumbs.db
64+
65+
# Folder config file
66+
Desktop.ini
67+
68+
# Recycle Bin used on file shares
69+
$RECYCLE.BIN/
70+
71+
# Mac desktop service store files
72+
.DS_Store
73+
74+
# JetBrains Rider
75+
.idea/
76+
*.sln.iml
77+
78+
# CodeRush
79+
.cr/
80+
81+
# Python Tools for Visual Studio (PTVS)
82+
__pycache__/
83+
*.pyc
84+
85+
# Cake - Uncomment if you are using it
86+
# tools/**
87+
# !tools/packages.config
88+
89+
# NCrunch
90+
_NCrunch_*
91+
.*crunch*.local.xml
92+
nCrunchTemp_*
93+
94+
# MightyMoose
95+
*.mm.*
96+
AutoTest.Net/
97+
98+
# Web workbench (sass)
99+
.sass-cache/
100+
101+
# Installshield output folder
102+
[Ee]xpress/
103+
104+
# DocProject is a documentation generator add-in
105+
DocProject/buildhelp/
106+
DocProject/Help/*.HxT
107+
DocProject/Help/*.HxC
108+
DocProject/Help/*.hhc
109+
DocProject/Help/*.hhk
110+
DocProject/Help/*.hhp
111+
DocProject/Help/Html2
112+
DocProject/Help/html
113+
114+
# Click-Once directory
115+
publish/
116+
117+
# Publish Web Output
118+
*.[Pp]ublish.xml
119+
*.azurePubxml
120+
121+
# NuGet Packages
122+
*.nupkg
123+
# The packages folder can be ignored because of Package Restore
124+
**/packages/*
125+
# except build/, which is used as an MSBuild target.
126+
!**/packages/build/
127+
# Uncomment if necessary however generally it will be regenerated when needed
128+
#!**/packages/repositories.config
129+
# NuGet v3's project.json files produces more ignoreable files
130+
*.nuget.props
131+
*.nuget.targets
132+
133+
# Microsoft Azure Build Output
134+
csx/
135+
*.build.csdef
136+
137+
# Microsoft Azure Emulator
138+
ecf/
139+
rcf/
140+
141+
# Windows Store app package directories and files
142+
AppPackages/
143+
BundleArtifacts/
144+
Package.StoreAssociation.xml
145+
_pkginfo.txt
146+
147+
# Visual Studio cache files
148+
# files ending in .cache can be ignored
149+
*.[Cc]ache
150+
# but keep track of directories ending in .cache
151+
!*.[Cc]ache/
152+
153+
# Others
154+
ClientBin/
155+
~$*
156+
*~
157+
*.dbmdl
158+
*.dbproj.schemaview
159+
*.jfm
160+
*.pfx
161+
*.publishsettings
162+
orleans.codegen.cs
163+
164+
# RIA/Silverlight projects
165+
Generated_Code/
166+
167+
# Backup & report files from converting an old project file
168+
# to a newer Visual Studio version. Backup files are not needed,
169+
# because we have git ;-)
170+
_UpgradeReport_Files/
171+
Backup*/
172+
UpgradeLog*.XML
173+
UpgradeLog*.htm
174+
175+
# SQL Server files
176+
*.mdf
177+
*.ldf
178+
*.ndf
179+
180+
# Business Intelligence projects
181+
*.rdl.data
182+
*.bim.layout
183+
*.bim_*.settings
184+
185+
# Microsoft Fakes
186+
FakesAssemblies/
187+
188+
# GhostDoc plugin setting file
189+
*.GhostDoc.xml
190+
191+
# Node.js Tools for Visual Studio
192+
.ntvs_analysis.dat
193+
node_modules/
194+
195+
# Typescript v1 declaration files
196+
typings/
197+
198+
# Visual Studio 6 build log
199+
*.plg
200+
201+
# Visual Studio 6 workspace options file
202+
*.opt
203+
204+
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
205+
*.vbw
206+
207+
# Visual Studio LightSwitch build output
208+
**/*.HTMLClient/GeneratedArtifacts
209+
**/*.DesktopClient/GeneratedArtifacts
210+
**/*.DesktopClient/ModelManifest.xml
211+
**/*.Server/GeneratedArtifacts
212+
**/*.Server/ModelManifest.xml
213+
_Pvt_Extensions
214+
215+
# Paket dependency manager
216+
.paket/paket.exe
217+
paket-files/
218+
219+
# FAKE - F# Make
220+
.fake/
221+
222+
# JetBrains Rider
223+
.idea/
224+
*.sln.iml
225+
226+
# CodeRush
227+
.cr/
228+
229+
# Python Tools for Visual Studio (PTVS)
230+
__pycache__/
231+
*.pyc
232+
233+
# Cake - Uncomment if you are using it
234+
# tools/
235+
236+
# Telerik's JustMock configuration file
237+
*.jmconfig
238+
239+
# BizTalk build output
240+
*.btp.cs
241+
*.btm.cs
242+
*.odx.cs
243+
*.xsd.cs

MinimalClean/MinimalClean.Architecture.slnx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<Platform Name="x86" />
66
</Configurations>
77
<Folder Name="/Solution Items/">
8+
<File Path="../MinimalClean.nuspec" />
89
<File Path=".editorconfig" />
9-
<File Path="CleanArchitecture.nuspec" />
1010
<File Path="Directory.Build.props" />
1111
<File Path="Directory.Packages.props" />
1212
</Folder>

MinimalClean/README.template.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,24 @@ dotnet run --project src/MinimalClean.Architecture.AspireHost
2121

2222
### Database Setup
2323

24+
This template uses **SQL Server in a container** managed by Aspire. When you run the Aspire AppHost, it automatically starts a SQL Server container and creates the database.
25+
26+
#### Option 1: Run with Aspire (Recommended)
27+
2428
```powershell
25-
dotnet ef database update -c AppDbContext -p src/MinimalClean.Architecture.Web -s src/MinimalClean.Architecture.Web
29+
dotnet run --project src/MinimalClean.Architecture.AspireHost
2630
```
2731

28-
The database file will be created at: `src/MinimalClean.Architecture.Web/ToDo.db`
32+
The SQL Server container and database are automatically provisioned and migrations are applied on startup.
33+
34+
#### Option 2: Run Web project directly (SQL Server LocalDB)
35+
36+
If running the Web project without Aspire, update `appsettings.json` to use LocalDB:
37+
38+
```powershell
39+
dotnet ef database update -c AppDbContext -p src/MinimalClean.Architecture.Web -s src/MinimalClean.Architecture.Web
40+
dotnet run --project src/MinimalClean.Architecture.Web
41+
```
2942

3043
## Project Structure
3144

@@ -70,10 +83,10 @@ This minimal template simplifies the full Clean Architecture template:
7083
| Full Template | Minimal Template |
7184
|--------------|------------------|
7285
| 4+ projects (Core, UseCases, Infrastructure, Web) | 1 Web project |
73-
| Repository pattern with Specifications | Direct DbContext usage (or simple repositories) |
86+
| Repository pattern with Specifications | Repository pattern with Specifications if needed |
7487
| Extensive use of interfaces and abstractions | Pragmatic abstractions where needed |
75-
| Separate Use Cases project with MediatR | Optional MediatR, logic can be in endpoints |
76-
| Complex domain patterns (Aggregates, Value Objects, Domain Events) | Simplified domain model, pragmatic DDD |
88+
| Separate Use Cases project with Mediator | Optional Mediator; logic can be in endpoints |
89+
| Complex domain patterns (Aggregates, Value Objects, Domain Events) | Pragmatic DDD patterns (Aggregates, Value Objects) |
7790

7891
## When to Use This Template
7992

@@ -98,8 +111,8 @@ This minimal template simplifies the full Clean Architecture template:
98111
- **.NET 10**: Latest LTS framework
99112
- **FastEndpoints**: REPR pattern for API endpoints
100113
- **Entity Framework Core**: Data access with migrations
101-
- **SQLite**: Default database (easily switched to SQL Server, PostgreSQL, etc.)
102-
- **Aspire**: Optional cloud-ready orchestration and observability
114+
- **SQL Server**: Containerized database via Aspire (easily switched to PostgreSQL, SQLite, etc.)
115+
- **Aspire**: Cloud-ready orchestration and observability
103116
- **Serilog**: Structured logging
104117
- **FluentValidation**: Request validation
105118

@@ -135,7 +148,7 @@ dotnet test
135148
As your application grows, you can migrate to the full Clean Architecture template:
136149

137150
1. **Extract Core**: Move Domain entities to separate Core project
138-
2. **Extract UseCases**: Move business logic to UseCases project with MediatR
151+
2. **Extract UseCases**: Move business logic to UseCases project with Mediator
139152
3. **Extract Infrastructure**: Move data access to Infrastructure project
140153
4. **Update Dependencies**: Set up proper dependency flow (Core ← UseCases ← Infrastructure)
141154

MinimalClean/src/MinimalClean.Architecture.Web/Configurations/ServiceConfigs.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public static IServiceCollection AddServiceConfigs(this IServiceCollection servi
2626
services.AddScoped<IEmailSender, MimeKitEmailSender>();
2727
}
2828

29-
logger.LogInformation("{Project} services registered", "Mediatr and Email Sender");
29+
logger.LogInformation("{Project} services registered", "Mediator and Email Sender");
3030

3131
return services;
3232
}

0 commit comments

Comments
 (0)