Skip to content

Commit 6147b3c

Browse files
authored
Merge branch 'master' into dependabot/github_actions/actions/checkout-6
2 parents 2a4757f + 0168059 commit 6147b3c

9 files changed

Lines changed: 223 additions & 138 deletions

File tree

.github/copilot-instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,5 @@ Example: `feat(api): add player search endpoint (#123)`
118118
feat(scope): description (#issue)
119119
120120
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
121+
Co-authored-by: Claude <noreply@anthropic.com>
121122
```

.github/dependabot.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ updates:
99
commit-message:
1010
include: scope
1111
prefix: "chore(deps): "
12-
# Pin AutoMapper to 14.x line to avoid commercial v15.x upgrades
13-
ignore:
14-
- dependency-name: "AutoMapper"
15-
update-types: ["version-update:semver-major"]
1612
groups:
1713
serilog:
1814
patterns:
@@ -34,10 +30,6 @@ updates:
3430
commit-message:
3531
include: scope
3632
prefix: "chore(deps): "
37-
# Pin AutoMapper to 14.x line to avoid commercial v15.x upgrades
38-
ignore:
39-
- dependency-name: "AutoMapper"
40-
update-types: ["version-update:semver-major"]
4133
groups:
4234
xunit:
4335
patterns:

.github/workflows/dotnet-cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ jobs:
136136
} >> $GITHUB_OUTPUT
137137
138138
- name: Create GitHub Release
139-
uses: softprops/action-gh-release@v2.5.0
139+
uses: softprops/action-gh-release@v2.6.0
140140
with:
141141
name: "v${{ steps.version.outputs.semver }} - ${{ steps.version.outputs.stadium }} 🏟️"
142142
tag_name: ${{ steps.version.outputs.tag_name }}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ This project uses famous football stadiums (A-Z) that hosted FIFA World Cup matc
4646

4747
### Changed
4848

49+
- Upgrade AutoMapper from 14.x to 16.1.1 to resolve high-severity security vulnerability GHSA-rvv3-g6hj-g44x (#414)
4950
- Rename test methods to follow Microsoft .NET naming standard (#396)
5051

5152
### Deprecated

README.md

Lines changed: 63 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Proof of Concept for a RESTful API built with .NET 10 (LTS) and ASP.NET Core. Ma
4444
## Tech Stack
4545

4646
| Category | Technology |
47-
|----------|------------|
47+
| -------- | ---------- |
4848
| **Framework** | [.NET 10](https://github.com/dotnet/core) (LTS) |
4949
| **Web Framework** | [ASP.NET Core 10.0](https://github.com/dotnet/aspnetcore) |
5050
| **API Documentation** | [Swashbuckle](https://github.com/domaindrivendev/Swashbuckle.AspNetCore) (OpenAPI 3.0) |
@@ -95,7 +95,7 @@ test/Dotnet.Samples.AspNetCore.WebApi.Tests/
9595

9696
## Architecture
9797

98-
Dependencies flow from data layer through repositories and services to controllers. External dependencies (AutoMapper, FluentValidation, Serilog, Swashbuckle) integrate at their respective layers.
98+
Layered architecture with dependency injection via constructors and interface-based contracts.
9999

100100
```mermaid
101101
@@ -112,11 +112,19 @@ Dependencies flow from data layer through repositories and services to controlle
112112
113113
graph RL
114114
115-
Models[Models]
115+
Tests[Tests]
116116
117-
subgraph Layer4[" "]
118-
Data[Data]
119-
Repositories[Repositories]
117+
subgraph Layer1[" "]
118+
Program[Program]
119+
Serilog[Serilog]
120+
Swashbuckle[Swashbuckle]
121+
end
122+
123+
subgraph Layer2[" "]
124+
Controllers[Controllers]
125+
Validators[Validators]
126+
FluentValidation[FluentValidation]
127+
AspNetCore[ASP.NET Core]
120128
end
121129
122130
subgraph Layer3[" "]
@@ -126,44 +134,43 @@ graph RL
126134
MemoryCache[MemoryCache]
127135
end
128136
129-
subgraph Layer2[" "]
130-
Controllers[Controllers]
131-
Validators[Validators]
132-
FluentValidation[FluentValidation]
133-
Swashbuckle[Swashbuckle]
137+
subgraph Layer4[" "]
138+
Repositories[Repositories]
139+
Data[Data]
140+
EFCore[EF Core]
134141
end
135142
136-
subgraph Layer1[" "]
137-
Program[Program]
138-
Configurations[Configurations]
139-
Serilog[Serilog]
140-
end
143+
Models[Models]
141144
142-
Tests[Tests]
145+
%% Strong dependencies
143146
144-
%% Application flow
145-
Data --> Models
146-
Models --> Repositories
147-
Repositories --> Services
148-
Services --> Controllers
147+
%% Layer 1
149148
Controllers --> Program
149+
Serilog --> Program
150+
Swashbuckle --> Program
150151
151-
%% Layer connections
152-
Models --> Mappings
152+
%% Layer 2
153+
Services --> Controllers
153154
Validators --> Controllers
154-
Mappings --> Services
155-
156-
%% External Dependencies connections
157-
AutoMapper --> Mappings
158155
FluentValidation --> Validators
159-
Serilog --> Program
160-
Swashbuckle --> Controllers
156+
AspNetCore --> Controllers
161157
162-
%% Supporting Features connections
163-
Configurations --> Program
158+
%% Layer 3
159+
Repositories --> Services
164160
MemoryCache --> Services
161+
Mappings --> Services
162+
AutoMapper --> Mappings
163+
Models --> Mappings
164+
165+
%% Layer 4
166+
Models --> Repositories
167+
Models --> Data
168+
Data --> Repositories
169+
EFCore --> Data
170+
EFCore -.-> Repositories
171+
172+
%% Soft dependencies
165173
166-
%% Tests connections
167174
Services -.-> Tests
168175
Controllers -.-> Tests
169176
@@ -176,10 +183,30 @@ graph RL
176183
class Data,Models,Repositories,Services,Controllers,Program,Validators,Mappings core;
177184
class AutoMapper,FluentValidation,Serilog,Swashbuckle deps;
178185
class Tests test;
179-
class Configurations,MemoryCache feat;
186+
class AspNetCore,EFCore,MemoryCache feat;
180187
```
181188

182-
*Layered architecture: Core application flow (blue), supporting features (yellow), external dependencies (red), and test coverage (green). Not all dependencies are shown.*
189+
### Arrow Semantics
190+
191+
Arrows point from a dependency toward its consumer. Solid arrows (`-->`) denote **strong (functional) dependencies**: the consumer actively invokes behavior — registering types with the IoC container, executing queries, applying mappings, or handling HTTP requests. Dotted arrows (`-.->`) denote **soft (structural) dependencies**: the consumer only references types or interfaces without invoking runtime behavior. This distinction follows UML's `«use»` dependency notation and classical coupling theory (Myers, 1978): strong arrows approximate *control or stamp coupling*, while soft arrows approximate *data coupling*, where only shared data structures cross the boundary.
192+
193+
### Composition Root Pattern
194+
195+
The `Program` module acts as the composition root — it is the sole site where dependencies are registered with the IoC container, wired via interfaces, and resolved at runtime by the ASP.NET Core host. Rather than explicit object construction, .NET relies on built-in dependency injection: `Program` registers services, repositories, DbContext, mappers, validators, and middleware, and the framework instantiates them on demand. This pattern enables dependency injection, improves testability, and ensures no other module bears responsibility for type registration or lifecycle management.
196+
197+
### Layered Architecture
198+
199+
The codebase is organized into four conceptual layers: Initialization (`Program`), HTTP (`Controllers`, `Validators`), Business (`Services`, `Mappings`), and Data (`Repositories`, `Data`).
200+
201+
Framework packages and third-party dependencies are co-resident within the layer that consumes them: `Serilog` and `Swashbuckle` inside Initialization, `ASP.NET Core` and `FluentValidation` inside HTTP, `AutoMapper` inside Business, and `EF Core` inside Data. `ASP.NET Core`, `EF Core`, and `MemoryCache` are Microsoft platform packages (yellow); `AutoMapper`, `FluentValidation`, `Serilog`, and `Swashbuckle` are third-party packages (red).
202+
203+
The `Models` package is a **cross-cutting type concern** — it defines shared entities and DTOs consumed across multiple layers via strong dependencies, without containing logic or behavior of its own. Dependencies always flow from consumers toward their lower-level types: each layer depends on (consumes) the layers below it, and no layer invokes behavior in a layer above it.
204+
205+
### Color Coding
206+
207+
Core packages (blue) implement the application logic, supporting features (yellow) are Microsoft platform packages, third-party dependencies (red) are community packages, and tests (green) ensure code quality.
208+
209+
*Simplified, conceptual view — not all components or dependencies are shown.*
183210

184211
## API Reference
185212

@@ -387,7 +414,7 @@ STORAGE_PATH=/storage/players-sqlite3.db
387414
## Command Summary
388415

389416
| Command | Description |
390-
|---------|-------------|
417+
| ------- | ----------- |
391418
| `dotnet watch run --project src/...` | Start development server with hot reload |
392419
| `dotnet build` | Build the solution |
393420
| `dotnet test` | Run all tests |

src/Dotnet.Samples.AspNetCore.WebApi/Dotnet.Samples.AspNetCore.WebApi.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<ItemGroup Label="Runtime dependencies">
1616
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.5" />
1717
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.5" />
18-
<PackageReference Include="AutoMapper" Version="[14.0.0,15.0.0)" />
18+
<PackageReference Include="AutoMapper" Version="[16.1.1,17.0.0)" />
1919
<PackageReference Include="FluentValidation" Version="12.1.1" />
2020
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="12.1.1" />
2121
<PackageReference Include="Serilog.AspNetCore" Version="10.0.0" />

src/Dotnet.Samples.AspNetCore.WebApi/Extensions/ServiceCollectionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public static IServiceCollection RegisterPlayerService(this IServiceCollection s
138138
/// <returns>The IServiceCollection for method chaining.</returns>
139139
public static IServiceCollection AddMappings(this IServiceCollection services)
140140
{
141-
services.AddAutoMapper(typeof(PlayerMappingProfile));
141+
services.AddAutoMapper(config => config.AddProfile<PlayerMappingProfile>());
142142
return services;
143143
}
144144

src/Dotnet.Samples.AspNetCore.WebApi/packages.lock.json

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
"net10.0": {
55
"AutoMapper": {
66
"type": "Direct",
7-
"requested": "[14.0.0, 15.0.0)",
8-
"resolved": "14.0.0",
9-
"contentHash": "OC+1neAPM4oCCqQj3g2GJ2shziNNhOkxmNB9cVS8jtx4JbgmRzLcUOxB9Tsz6cVPHugdkHgCaCrTjjSI0Z5sCQ=="
7+
"requested": "[16.1.1, 17.0.0)",
8+
"resolved": "16.1.1",
9+
"contentHash": "VNEky8JA15ci+oIDRGHITOGOpV4dILsf8pnn24QhDl2urtqgJ2IXiS/V2EtGU17P/+f6OeFQPJETaZXV9QOIZg==",
10+
"dependencies": {
11+
"Microsoft.IdentityModel.JsonWebTokens": "8.14.0"
12+
}
1013
},
1114
"FluentValidation": {
1215
"type": "Direct",
@@ -815,6 +818,35 @@
815818
"resolved": "10.0.5",
816819
"contentHash": "xA4kkL+QS6KCAOKz/O0oquHs44Ob8J7zpBCNt3wjkBWDg5aCqfwG8rWWLsg5V86AM0sB849g9JjPjIdksTCIKg=="
817820
},
821+
"Microsoft.IdentityModel.Abstractions": {
822+
"type": "Transitive",
823+
"resolved": "8.14.0",
824+
"contentHash": "iwbCpSjD3ehfTwBhtSNEtKPK0ICun6ov7Ibx6ISNA9bfwIyzI2Siwyi9eJFCJBwxowK9xcA1mj+jBWiigeqgcQ=="
825+
},
826+
"Microsoft.IdentityModel.JsonWebTokens": {
827+
"type": "Transitive",
828+
"resolved": "8.14.0",
829+
"contentHash": "4jOpiA4THdtpLyMdAb24dtj7+6GmvhOhxf5XHLYWmPKF8ApEnApal1UnJsKO4HxUWRXDA6C4WQVfYyqsRhpNpQ==",
830+
"dependencies": {
831+
"Microsoft.IdentityModel.Tokens": "8.14.0"
832+
}
833+
},
834+
"Microsoft.IdentityModel.Logging": {
835+
"type": "Transitive",
836+
"resolved": "8.14.0",
837+
"contentHash": "eqqnemdW38CKZEHS6diA50BV94QICozDZEvSrsvN3SJXUFwVB9gy+/oz76gldP7nZliA16IglXjXTCTdmU/Ejg==",
838+
"dependencies": {
839+
"Microsoft.IdentityModel.Abstractions": "8.14.0"
840+
}
841+
},
842+
"Microsoft.IdentityModel.Tokens": {
843+
"type": "Transitive",
844+
"resolved": "8.14.0",
845+
"contentHash": "lKIZiBiGd36k02TCdMHp1KlNWisyIvQxcYJvIkz7P4gSQ9zi8dgh6S5Grj8NNG7HWYIPfQymGyoZ6JB5d1Lo1g==",
846+
"dependencies": {
847+
"Microsoft.IdentityModel.Logging": "8.14.0"
848+
}
849+
},
818850
"Microsoft.NET.StringTools": {
819851
"type": "Transitive",
820852
"resolved": "17.11.48",

0 commit comments

Comments
 (0)