Skip to content

Commit c9bba54

Browse files
committed
fix: some analyser messages
1 parent 6689b2d commit c9bba54

20 files changed

Lines changed: 263 additions & 40 deletions

File tree

Template.slnx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<Solution>
2-
<Project Path=".net.csproj" />
2+
<Project Path="src/.net.csproj" />
33
<Folder Name="/src/">
44
<Project Path="src/Api/Template.Api.csproj" />
55
<Project Path="src/AppHost/Template.AppHost.csproj" />
6-
<Project Path="src/Generators/Template.Generators.csproj" />
6+
<Project Path="src/Generators/Template.Generators.csproj" />
77
<Project Path="src/ServiceDefaults/Template.ServiceDefaults.csproj" />
88
<Project Path="src/WebUi/Template.WebUi.csproj" />
99
</Folder>

docfx.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
"files": ["docs/api/**.yml"]
66
},
77
{
8-
"files": ["docs/**.md", "docs/**/toc.yml", "toc.yml", "*.md"]
8+
"files": ["docs/**.md", "docs/**/toc.yml", "toc.yml", "index.md"]
99
},
1010
{
11-
"files": ["src/**/*.md"]
12-
},
13-
{
14-
"files": ["install/**.md", "LICENSE"]
11+
"files": ["src/**/*.md"],
12+
"exclude": ["src/WebUi/node_modules/**"]
1513
}
1614
],
1715
"resource": [

docs/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Documentation and Usage
2+
3+
This section describes how the repository is organized and what belongs in each
4+
solution folder.
5+
6+
- Start here: [Solution Folder Guide](solution-folders.md)
7+
- API reference is generated under [API Reference](api/index.md)

docs/solution-folders.md

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
# Solution Folder Guide
2+
3+
This guide defines what belongs in each folder represented by the solution and
4+
its projects.
5+
6+
## Top-Level Solution Folders
7+
8+
### src/
9+
10+
Production code lives here. Keep reusable and deployable components under
11+
project-specific folders.
12+
13+
Contains:
14+
15+
- `AppHost/`: Aspire orchestration and deployment composition.
16+
- `Api/`: ASP.NET Core application with domain and infrastructure.
17+
- `Generators/`: Roslyn source generators and analyzers.
18+
- `ServiceDefaults/`: Shared service configuration extensions.
19+
- `WebUi/`: Frontend app and embedded static assets.
20+
21+
Does not contain:
22+
23+
- Unit tests.
24+
- Temporary scripts or scratch files.
25+
- Build artifacts (bin/obj output only).
26+
27+
### test/
28+
29+
Automated tests live here.
30+
31+
Contains:
32+
33+
- `Template.Tests/`: Domain and feature tests for the template API.
34+
35+
Does not contain:
36+
37+
- Production implementation code.
38+
- Manual test notes or ad-hoc run output.
39+
40+
## Project Folder Responsibilities
41+
42+
### src/AppHost/
43+
44+
Use this project for distributed application orchestration.
45+
46+
Put here:
47+
48+
- Resource wiring for API, Redis, PostgreSQL, and related infrastructure.
49+
- Deployment and image publishing configuration used by Aspire.
50+
- Environment-specific orchestration settings.
51+
52+
Avoid here:
53+
54+
- Business logic.
55+
- HTTP endpoint handlers.
56+
57+
### src/Api/
58+
59+
Core backend application code.
60+
61+
Put here:
62+
63+
- API endpoints and request handlers.
64+
- Domain entities, value objects, and domain abstractions.
65+
- Infrastructure integrations (data access, event bus, persistence).
66+
- Runtime configuration and middleware registration.
67+
68+
Avoid here:
69+
70+
- Frontend-only assets.
71+
- Test-only helper code.
72+
73+
### src/Api/Configuration/
74+
75+
Application setup and runtime wiring.
76+
77+
Put here:
78+
79+
- DI registrations.
80+
- options classes and binding.
81+
- Middleware and host configuration extensions.
82+
83+
### src/Api/Domain/
84+
85+
Business rules and domain model.
86+
87+
Put here:
88+
89+
- Entities and aggregates.
90+
- Value objects and IDs.
91+
- Domain events and domain interfaces.
92+
93+
Keep this layer independent from infrastructure details.
94+
95+
### src/Api/Features/
96+
97+
Vertical slices for use cases.
98+
99+
Put here:
100+
101+
- Endpoint mapping for each feature area.
102+
- Command/query handlers for API operations.
103+
104+
Avoid direct coupling to infrastructure implementation types when domain
105+
abstractions can be used.
106+
107+
### src/Api/Infrastructure/
108+
109+
Technical implementation details.
110+
111+
Put here:
112+
113+
- EF Core DbContext, migrations, and query implementations.
114+
- Event bus implementation and serialization.
115+
- Persistence-related services.
116+
117+
### src/Generators/
118+
119+
Compile-time analyzers and source generation.
120+
121+
Put here:
122+
123+
- Analyzer diagnostics and rules.
124+
- Code-generation templates and generator implementations.
125+
- Release notes for analyzer versions.
126+
127+
### src/ServiceDefaults/
128+
129+
Cross-cutting service behavior shared by applications.
130+
131+
Put here:
132+
133+
- Logging, telemetry, resilience, and discovery defaults.
134+
- Extension methods consumed by host projects.
135+
136+
### src/WebUi/
137+
138+
Frontend source and build packaging for embedding in .NET artifacts.
139+
140+
Put here:
141+
142+
- Vite and TypeScript configuration.
143+
- Vue components and static frontend assets.
144+
- Build output packaging logic used by the .NET project.
145+
146+
Avoid here:
147+
148+
- Backend domain logic.
149+
150+
### test/Template.Tests/
151+
152+
Test project for template behavior.
153+
154+
Put here:
155+
156+
- Unit and feature tests for domain and API handlers.
157+
- Test doubles and helper fixtures used by tests.
158+
159+
Avoid here:
160+
161+
- Application startup or deployment code.
162+
163+
## Non-Solution Support Folders
164+
165+
These folders support development but are not primary solution code folders.
166+
167+
- `.github/`: CI/CD and automation workflows.
168+
- `docs/`: Documentation source files for DocFX and Pages.
169+
- `assets/`: Shared documentation assets.
170+
- `artifacts/`: Generated build outputs.

docs/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- name: Overview
2+
href: index.md
3+
- name: Solution Folder Guide
4+
href: solution-folders.md

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "10.0"
3+
"version": "10.0.204"
44
},
55
"test": {
66
"runner": "Microsoft.Testing.Platform"

index.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

.net.csproj renamed to src/.net.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup Label="Include your files as content">
14-
<Content Include="**/*.*" />
14+
<Content Include="../**/*.*" />
1515
</ItemGroup>
1616

1717
<ItemGroup Label="Exclude build output and source files">
18-
<Content Remove="artifacts\**" />
19-
<Content Remove="bin\**" />
20-
<Content Remove="obj\**" />
21-
<Content Remove="src\**" />
22-
<Content Remove="test\**" />
18+
<Content Remove="../artifacts/**" />
19+
<Content Remove="../bin/**" />
20+
<Content Remove="../obj/**" />
21+
<Content Remove="../src/**" />
22+
<Content Remove="../test/**" />
2323
</ItemGroup>
2424

2525
</Project>

src/Api/Domain/Abstractions/IRepository.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,3 @@ public async Task DeleteAsync(TId id, CancellationToken cancellationToken = defa
1313
}
1414
}
1515

16-
public interface IUnitOfWork
17-
{
18-
IRepository<TAggregate, TId> GetRepository<TAggregate, TId>()
19-
where TAggregate : AggregateRoot
20-
where TId : struct;
21-
22-
Task<int> SaveChangesAsync(CancellationToken cancellationToken = default);
23-
}
24-
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
namespace Template.Api.Domain.Abstractions;
2+
3+
public interface IUnitOfWork
4+
{
5+
IRepository<TAggregate, TId> GetRepository<TAggregate, TId>()
6+
where TAggregate : AggregateRoot
7+
where TId : struct;
8+
9+
Task<int> SaveChangesAsync(CancellationToken cancellationToken = default);
10+
}
11+

0 commit comments

Comments
 (0)