From e567c49a1494de3574a90c2c295eab9341885c5d Mon Sep 17 00:00:00 2001 From: Dmytro Khmara Date: Mon, 7 Jul 2025 23:00:37 +0100 Subject: [PATCH] Add .NET 8 and 9 support. --- Dockerfile | 8 ++++---- LICENSE.txt | 2 +- README.md | 10 ++++++---- src/StrEnum.AspNetCore/StrEnum.AspNetCore.csproj | 8 ++++---- .../StrEnum.AspNetCore.IntegrationTests.csproj | 14 +++++++------- 5 files changed, 22 insertions(+), 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index 27de2bc..d446dc8 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:9.0 AS build WORKDIR /source # copy csproj and restore as distinct layers @@ -10,12 +10,12 @@ RUN dotnet restore # copy everything else and build app COPY ./ ./ WORKDIR /source -RUN dotnet build -c release -o /out/package --no-restore /p:maxcpucount=1 +RUN dotnet build -c release --no-restore /p:maxcpucount=1 -FROM build as test +FROM build AS test RUN dotnet test /p:maxcpucount=1 -FROM build as pack-and-push +FROM build AS pack-and-push WORKDIR /source ARG PackageVersion diff --git a/LICENSE.txt b/LICENSE.txt index 80f4a85..8d1eab2 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 Dmitry Khmara +Copyright (c) 2025 Dmytro Khmara Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index b1ea74d..f3d5a45 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,9 @@ Allows to use [StrEnum](https://github.com/StrEnum/StrEnum/) string enums with ASP.NET Core. -Supports ASP.NET Core 6 and 7. ASP.NET Core 5 supported in v2.0.0. +Supports ASP.NET Core 6, 7, 8, and 9. + +ASP.NET Core 5 supported in v2.0.0. ## Installation @@ -14,7 +16,7 @@ dotnet add package StrEnum.AspNetCore ## Usage -If you're using the new ASP.NET Core 6`WebApplicationBuilder`, add the call to `AddStringEnums()` into your `Program.cs`: +If you're using `WebApplicationBuilder`, add the call to `AddStringEnums()` into your `Program.cs`: ```csharp var builder = WebApplication.CreateBuilder(args); @@ -24,7 +26,7 @@ builder.Services .AddStringEnums(); ``` -If you're using the ASP.NET Core 3.1/5 `IWebHostBuilder`, call `AddStringEnums()` in the `ConfigureServices` method of your `Startup.cs`: +If you're using the ASP.NET Core 3.1-5 `IWebHostBuilder`, call `AddStringEnums()` in the `ConfigureServices` method of your `Startup.cs`: ```csharp public void ConfigureServices(IServiceCollection services) @@ -89,6 +91,6 @@ public ActionResult GetFromQuery([FromQuery] Sport[] sports ## License -Copyright © 2022 [Dmitry Khmara](https://dmitrykhmara.com). +Copyright © 2025 [Dmytro Khmara](https://dmytrokhmara.com). StrEnum is licensed under the [MIT license](LICENSE.txt). diff --git a/src/StrEnum.AspNetCore/StrEnum.AspNetCore.csproj b/src/StrEnum.AspNetCore/StrEnum.AspNetCore.csproj index 01f0c09..1d740d1 100644 --- a/src/StrEnum.AspNetCore/StrEnum.AspNetCore.csproj +++ b/src/StrEnum.AspNetCore/StrEnum.AspNetCore.csproj @@ -3,8 +3,8 @@ StrEnum.AspNetCore String enum support for ASP.NET Core. - Dmitry Khmara - Copyright Dmitry Khmara + Dmytro Khmara + Copyright Dmytro Khmara README.md StringEnum;String;Enum;ASP.NET Core icon.png @@ -12,7 +12,7 @@ git https://github.com/StrEnum/StrEnum - netcoreapp3.1;net6.0;net7.0 + netcoreapp3.1;net6.0;net7.0;net8.0;net9.0 enable 10.0 enable @@ -20,7 +20,7 @@ - + diff --git a/test/StrEnum.AspNetCore.IntegrationTests/StrEnum.AspNetCore.IntegrationTests.csproj b/test/StrEnum.AspNetCore.IntegrationTests/StrEnum.AspNetCore.IntegrationTests.csproj index ea45daf..d0b23d0 100644 --- a/test/StrEnum.AspNetCore.IntegrationTests/StrEnum.AspNetCore.IntegrationTests.csproj +++ b/test/StrEnum.AspNetCore.IntegrationTests/StrEnum.AspNetCore.IntegrationTests.csproj @@ -1,22 +1,22 @@  - net7.0 + net9.0 enable false - - - - - + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all