diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 065527d..5be095b 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -27,6 +27,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 + - name: Setup dotnet + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.x.x' + - name: Initialize CodeQL uses: github/codeql-action/init@v2 with: diff --git a/.github/workflows/dependency-updates.yml b/.github/workflows/dependency-updates.yml index 1b28a04..460aa03 100644 --- a/.github/workflows/dependency-updates.yml +++ b/.github/workflows/dependency-updates.yml @@ -20,7 +20,7 @@ jobs: - name: Install .NET Core uses: actions/setup-dotnet@v3 with: - dotnet-version: 7.x.x + dotnet-version: 8.x.x - name: Install dotnet-outdated run: dotnet tool install --global dotnet-outdated-tool diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 6f0722f..0c6027b 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -23,7 +23,7 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: | - 7.x.x + 8.x.x # 6.x.x # - name: Check for vulnerabilities # run: | diff --git a/CleanArchitecture.Api/CleanArchitecture.Api.csproj b/CleanArchitecture.Api/CleanArchitecture.Api.csproj index 4cda0e0..1a53d65 100644 --- a/CleanArchitecture.Api/CleanArchitecture.Api.csproj +++ b/CleanArchitecture.Api/CleanArchitecture.Api.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 enable 64377c40-44d6-4989-9662-5d778f8b3b92 @@ -12,15 +12,15 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + diff --git a/CleanArchitecture.Application.Tests/CleanArchitecture.Application.Tests.csproj b/CleanArchitecture.Application.Tests/CleanArchitecture.Application.Tests.csproj index 7ac6880..8c222c0 100644 --- a/CleanArchitecture.Application.Tests/CleanArchitecture.Application.Tests.csproj +++ b/CleanArchitecture.Application.Tests/CleanArchitecture.Application.Tests.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable false @@ -9,10 +9,10 @@ - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/CleanArchitecture.Application/CleanArchitecture.Application.csproj b/CleanArchitecture.Application/CleanArchitecture.Application.csproj index dd7f8ef..de72048 100644 --- a/CleanArchitecture.Application/CleanArchitecture.Application.csproj +++ b/CleanArchitecture.Application/CleanArchitecture.Application.csproj @@ -1,12 +1,12 @@ - net7.0 + net8.0 enable - + diff --git a/CleanArchitecture.Domain.Tests/CleanArchitecture.Domain.Tests.csproj b/CleanArchitecture.Domain.Tests/CleanArchitecture.Domain.Tests.csproj index ee3de39..ab63a54 100644 --- a/CleanArchitecture.Domain.Tests/CleanArchitecture.Domain.Tests.csproj +++ b/CleanArchitecture.Domain.Tests/CleanArchitecture.Domain.Tests.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable false @@ -10,9 +10,9 @@ - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/CleanArchitecture.Domain/CleanArchitecture.Domain.csproj b/CleanArchitecture.Domain/CleanArchitecture.Domain.csproj index 1c1d9ff..67cf3be 100644 --- a/CleanArchitecture.Domain/CleanArchitecture.Domain.csproj +++ b/CleanArchitecture.Domain/CleanArchitecture.Domain.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable @@ -9,7 +9,7 @@ - + diff --git a/CleanArchitecture.Infrastructure.Tests/CleanArchitecture.Infrastructure.Tests.csproj b/CleanArchitecture.Infrastructure.Tests/CleanArchitecture.Infrastructure.Tests.csproj index aa725bb..7df52a6 100644 --- a/CleanArchitecture.Infrastructure.Tests/CleanArchitecture.Infrastructure.Tests.csproj +++ b/CleanArchitecture.Infrastructure.Tests/CleanArchitecture.Infrastructure.Tests.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable false @@ -9,9 +9,9 @@ - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/CleanArchitecture.Infrastructure/CleanArchitecture.Infrastructure.csproj b/CleanArchitecture.Infrastructure/CleanArchitecture.Infrastructure.csproj index e18aeb3..de5234e 100644 --- a/CleanArchitecture.Infrastructure/CleanArchitecture.Infrastructure.csproj +++ b/CleanArchitecture.Infrastructure/CleanArchitecture.Infrastructure.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable @@ -12,10 +12,10 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/CleanArchitecture.IntegrationTests/CleanArchitecture.IntegrationTests.csproj b/CleanArchitecture.IntegrationTests/CleanArchitecture.IntegrationTests.csproj index 8c6650f..b259217 100644 --- a/CleanArchitecture.IntegrationTests/CleanArchitecture.IntegrationTests.csproj +++ b/CleanArchitecture.IntegrationTests/CleanArchitecture.IntegrationTests.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable false @@ -9,12 +9,12 @@ - - - - - - + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/CleanArchitecture.IntegrationTests/Infrastructure/Auth/TestAuthenticationHandler.cs b/CleanArchitecture.IntegrationTests/Infrastructure/Auth/TestAuthenticationHandler.cs index db98295..57f7faa 100644 --- a/CleanArchitecture.IntegrationTests/Infrastructure/Auth/TestAuthenticationHandler.cs +++ b/CleanArchitecture.IntegrationTests/Infrastructure/Auth/TestAuthenticationHandler.cs @@ -12,8 +12,7 @@ public sealed class TestAuthenticationHandler : AuthenticationHandler options, ILoggerFactory logger, - UrlEncoder encoder, - ISystemClock clock) : base(options, logger, encoder, clock) + UrlEncoder encoder) : base(options, logger, encoder) { } diff --git a/CleanArchitecture.Proto/CleanArchitecture.Proto.csproj b/CleanArchitecture.Proto/CleanArchitecture.Proto.csproj index 013eb28..685f659 100644 --- a/CleanArchitecture.Proto/CleanArchitecture.Proto.csproj +++ b/CleanArchitecture.Proto/CleanArchitecture.Proto.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable @@ -13,9 +13,9 @@ - - - + + + diff --git a/CleanArchitecture.Shared/CleanArchitecture.Shared.csproj b/CleanArchitecture.Shared/CleanArchitecture.Shared.csproj index 812e7fd..5ea58b1 100644 --- a/CleanArchitecture.Shared/CleanArchitecture.Shared.csproj +++ b/CleanArchitecture.Shared/CleanArchitecture.Shared.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable diff --git a/CleanArchitecture.gRPC.Tests/CleanArchitecture.gRPC.Tests.csproj b/CleanArchitecture.gRPC.Tests/CleanArchitecture.gRPC.Tests.csproj index 9b5c040..b60b2fb 100644 --- a/CleanArchitecture.gRPC.Tests/CleanArchitecture.gRPC.Tests.csproj +++ b/CleanArchitecture.gRPC.Tests/CleanArchitecture.gRPC.Tests.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable false @@ -9,10 +9,10 @@ - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/CleanArchitecture.gRPC/CleanArchitecture.gRPC.csproj b/CleanArchitecture.gRPC/CleanArchitecture.gRPC.csproj index 068e549..e106542 100644 --- a/CleanArchitecture.gRPC/CleanArchitecture.gRPC.csproj +++ b/CleanArchitecture.gRPC/CleanArchitecture.gRPC.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 enable diff --git a/Dockerfile b/Dockerfile index 646bd78..0704fd1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /app # copy csproj and restore as distinct layers @@ -10,7 +10,7 @@ COPY CleanArchitecture.Api/. ./CleanArchitecture.Api/ WORKDIR /app/CleanArchitecture.Api RUN dotnet publish -c Release -o out -FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS runtime +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime WORKDIR /app COPY --from=build /app/CleanArchitecture.Api/out ./ diff --git a/Readme.md b/Readme.md index 722e13b..d2c35c5 100644 --- a/Readme.md +++ b/Readme.md @@ -1,4 +1,4 @@ -# Clean Architecture Dotnet 7 API Project +# Clean Architecture Dotnet 8 API Project ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/alex289/CleanArchitecture/dotnet.yml) @@ -78,4 +78,4 @@ To run the tests, follow these steps: This project uses GitHub Actions to build and test the project on every commit to the main branch. The workflow consists of several steps, including restoring packages, building the project and running tests. ## Conclusion -This project is a sample implementation of the Clean Architecture principles, Onion Architecture, MediatR, and Entity Framework. It demonstrates how to organize a .NET 7 API project into layers, how to use the MediatR library to implement the mediator pattern, and how to use Entity Framework to access data. It also includes unit tests for all layers and integration tests using xUnit. +This project is a sample implementation of the Clean Architecture principles, Onion Architecture, MediatR, and Entity Framework. It demonstrates how to organize a .NET 8 API project into layers, how to use the MediatR library to implement the mediator pattern, and how to use Entity Framework to access data. It also includes unit tests for all layers and integration tests using xUnit.