Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

## Quick Context

ASP.NET Core 8 REST API with layered architecture
**Stack**: .NET 8 LTS, EF Core 9, SQLite, Docker, xUnit
ASP.NET Core 10 REST API with layered architecture
**Stack**: .NET 10 LTS, EF Core 10, SQLite, Docker, xUnit
**Pattern**: Repository + Service + AutoMapper + FluentValidation
**Focus**: Learning PoC emphasizing clarity and best practices

Expand All @@ -19,7 +19,11 @@ ASP.NET Core 8 REST API with layered architecture
- **Logging**: Serilog with structured logging
- **Testing**: xUnit + Moq + FluentAssertions
- **Formatting**: CSharpier
- **Commits**: Subject ≤80 chars, include issue number (#123), body lines ≤80 chars, conventional commits
- **Commits**: Conventional Commits with issue number suffix
- Format: `type(scope): description (#issue)` (max 80 chars)
- Types: feat, fix, chore, docs, test, refactor
- Example: `feat(api): add player search endpoint (#123)`
- Body lines ≤80 chars

## Architecture

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- 'v*.*.*-*'

env:
DOTNET_VERSION: 8.0.x
DOTNET_VERSION: 10.0.x
PACKAGE_NAME: nanotaboada/dotnet-samples-aspnetcore-webapi

jobs:
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/dotnet-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
branches: [ "master" ]

env:
DOTNET_VERSION: 8.0.x
DOTNET_VERSION: 10.0.x

jobs:
build:
Expand Down Expand Up @@ -49,6 +49,15 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v6.0.2

- name: Set up .NET ${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v5.1.0
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
cache: true
cache-dependency-path: |
src/Dotnet.Samples.AspNetCore.WebApi/packages.lock.json
test/Dotnet.Samples.AspNetCore.WebApi.Tests/packages.lock.json

- name: Lint commit messages
uses: wagoid/commitlint-github-action@v6.2.1

Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ curl https://localhost:9000/health

## .NET Version

This project targets **.NET 8 (LTS)**.
This project targets **.NET 10 (LTS)**.

## Development Workflow

Expand Down
30 changes: 22 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,8 @@ This project uses famous football stadiums (A-Z) that hosted FIFA World Cup matc

### Added

- Token efficiency strategy for Copilot/AI agents with optimized instruction loading and improved token counting script (#364)

### Changed

- Bump Swashbuckle.AspNetCore from 10.1.0 to 10.1.2
- Bump docker/login-action from 3.6.0 to 3.7.0
- Bump softprops/action-gh-release from 2.2.0 to 2.5.0
- Bump actions/checkout from 6.0.1 to 6.0.2

### Deprecated

### Removed
Expand All @@ -63,6 +56,26 @@ This project uses famous football stadiums (A-Z) that hosted FIFA World Cup matc

---

## [1.1.0 - bernabeu] - 2026-02-09

### Changed

- Upgrade to .NET 10 LTS from .NET 8 (#368)
- Update Microsoft.AspNetCore.OpenApi to 10.0.0
- Update Microsoft.EntityFrameworkCore.Sqlite to 10.0.0
- Update Microsoft.EntityFrameworkCore.Design to 10.0.0
- Update Microsoft.VisualStudio.Web.CodeGeneration.Design to 10.0.0
- Update Docker images to .NET 10 SDK and runtime (now based on Ubuntu 24.04 LTS instead of Debian 12)
- Update Dockerfile user creation commands for Ubuntu compatibility (`groupadd`/`useradd` instead of `adduser`)
- Update CI/CD pipelines to use .NET 10 SDK
- Token efficiency strategy for Copilot/AI agents with optimized instruction loading and improved token counting script (#364)
- Bump Swashbuckle.AspNetCore from 10.1.0 to 10.1.2
- Bump docker/login-action from 3.6.0 to 3.7.0
- Bump softprops/action-gh-release from 2.2.0 to 2.5.0
- Bump actions/checkout from 6.0.1 to 6.0.2

---

## [1.0.0 - azteca] - 2026-01-22

Initial release. See [README.md](README.md) for complete feature list and documentation.
Expand Down Expand Up @@ -154,5 +167,6 @@ The CD workflow automatically:

---

[unreleased]: https://github.com/nanotaboada/Dotnet.Samples.AspNetCore.WebApi/compare/v1.0.0-azteca...HEAD
[unreleased]: https://github.com/nanotaboada/Dotnet.Samples.AspNetCore.WebApi/compare/v1.1.0-bernabeu...HEAD
[1.1.0 - bernabeu]: https://github.com/nanotaboada/Dotnet.Samples.AspNetCore.WebApi/compare/v1.0.0-azteca...v1.1.0-bernabeu
[1.0.0 - azteca]: https://github.com/nanotaboada/Dotnet.Samples.AspNetCore.WebApi/releases/tag/v1.0.0-azteca
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Stage 1: Builder
# This stage builds the application and its dependencies.
# ------------------------------------------------------------------------------
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS builder
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS builder

WORKDIR /src

Expand All @@ -22,7 +22,7 @@ RUN dotnet publish -c Release -o /app/publish
# Stage 2: Runtime
# This stage creates the final, minimal image to run the application.
# ------------------------------------------------------------------------------
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime

WORKDIR /app

Expand All @@ -31,8 +31,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends curl && \
rm -rf /var/lib/apt/lists/*

# Metadata labels for the image. These are useful for registries and inspection.
LABEL org.opencontainers.image.title="🧪 Web API made with .NET 8 (LTS) and ASP.NET Core"
LABEL org.opencontainers.image.description="Proof of Concept for a Web API made with .NET 8 (LTS) and ASP.NET Core"
LABEL org.opencontainers.image.title="🧪 Web API made with .NET 10 (LTS) and ASP.NET Core"
LABEL org.opencontainers.image.description="Proof of Concept for a Web API made with .NET 10 (LTS) and ASP.NET Core"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.source="https://github.com/nanotaboada/Dotnet.Samples.AspNetCore.WebApi"

Expand All @@ -57,7 +57,7 @@ COPY --chmod=555 scripts/healthcheck.sh ./healthcheck.sh
COPY --from=builder /src/Dotnet.Samples.AspNetCore.WebApi/storage/players-sqlite3.db ./hold/players-sqlite3.db

# Add non-root user and make volume mount point writable
RUN adduser --system --disabled-password --group aspnetcore && \
RUN groupadd -r aspnetcore && useradd -r -g aspnetcore aspnetcore && \
mkdir -p /storage && \
chown aspnetcore:aspnetcore /storage

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[![CodeFactor](https://www.codefactor.io/repository/github/nanotaboada/Dotnet.Samples.AspNetCore.WebApi/badge)](https://www.codefactor.io/repository/github/nanotaboada/Dotnet.Samples.AspNetCore.WebApi)
[![License: MIT](https://img.shields.io/badge/License-MIT-white.svg)](https://opensource.org/licenses/MIT)

Proof of Concept for a RESTful API built with .NET 8 (LTS) and ASP.NET Core. Manage football player data with SQLite, Entity Framework Core, Swagger documentation, and in-memory caching.
Proof of Concept for a RESTful API built with .NET 10 (LTS) and ASP.NET Core. Manage football player data with SQLite, Entity Framework Core, Swagger documentation, and in-memory caching.

## Table of Contents

Expand Down Expand Up @@ -43,13 +43,13 @@ Proof of Concept for a RESTful API built with .NET 8 (LTS) and ASP.NET Core. Man

| Category | Technology |
|----------|------------|
| **Framework** | [.NET 8](https://github.com/dotnet/core) (LTS) |
| **Web Framework** | [ASP.NET Core 8.0](https://github.com/dotnet/aspnetcore) |
| **Framework** | [.NET 10](https://github.com/dotnet/core) (LTS) |
| **Web Framework** | [ASP.NET Core 10.0](https://github.com/dotnet/aspnetcore) |
| **API Documentation** | [Swashbuckle](https://github.com/domaindrivendev/Swashbuckle.AspNetCore) (OpenAPI 3.0) |
| **Validation** | [FluentValidation 12](https://github.com/FluentValidation/FluentValidation) |
| **Mapping** | [AutoMapper 14](https://github.com/AutoMapper/AutoMapper) |
| **Database** | [SQLite 3](https://github.com/sqlite/sqlite) |
| **ORM** | [Entity Framework Core 9.0](https://github.com/dotnet/efcore) |
| **ORM** | [Entity Framework Core 10.0](https://github.com/dotnet/efcore) |
| **Logging** | [Serilog 9](https://github.com/serilog/serilog) |
| **Testing** | [xUnit](https://github.com/xunit/xunit), [Moq](https://github.com/devlooped/moq), [FluentAssertions](https://github.com/fluentassertions/fluentassertions) |
| **Containerization** | [Docker](https://github.com/docker) & [Docker Compose](https://github.com/docker/compose) |
Expand Down Expand Up @@ -204,7 +204,7 @@ For complete endpoint documentation with request/response schemas, explore the [

Before you begin, ensure you have the following installed:

- .NET 8 SDK (LTS) or higher
- .NET 10 SDK (LTS) or higher
- Docker Desktop (optional, for containerized deployment)
- dotnet-ef CLI tool (for database migrations)

Expand Down
12 changes: 6 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ASP.NET Core 8.0
# Build and test ASP.NET Core projects targeting .NET 8 on Linux.
# ASP.NET Core 10.0
# Build and test ASP.NET Core projects targeting .NET 10 on Linux.
# https://learn.microsoft.com/en-us/azure/devops/pipelines/ecosystems/dotnet-core

# Pipeline triggers:
Expand All @@ -26,7 +26,7 @@ variables:

# Pipeline steps (equivalent to GitHub Actions 'steps:')
steps:
# Checkout repository (equivalent to actions/checkout@v6)
# Checkout repository (equivalent to actions/checkout)
# Azure Pipelines does this implicitly, but making it explicit for clarity
- checkout: self
displayName: "Checkout repository"
Expand All @@ -41,12 +41,12 @@ steps:
nuget | "$(Agent.OS)"
path: $(NUGET_PACKAGES)

# Install .NET 8 SDK (equivalent to actions/setup-dotnet@v5)
# Install .NET 10 SDK (equivalent to actions/setup-dotnet)
# performMultiLevelLookup: allows finding other SDK versions if needed
- task: UseDotNet@2
displayName: "Set up .NET 8"
displayName: "Set up .NET 10"
inputs:
version: "8.x"
version: "10.x"
performMultiLevelLookup: true

# Restore NuGet packages (equivalent to 'dotnet restore')
Expand Down
6 changes: 6 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "10.0.100",
"rollForward": "latestFeature"
}
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>

<ItemGroup Label="Development dependencies">
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="9.0.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.12" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="10.0.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.0" PrivateAssets="all" />
</ItemGroup>

<ItemGroup Label="Runtime dependencies">
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.23" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.12" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.2" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.0" />
<PackageReference Include="AutoMapper" Version="[14.0.0,15.0.0)" />
<PackageReference Include="FluentValidation" Version="12.1.1" />
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="12.1.1" />
Expand Down
Loading