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
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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);
Expand All @@ -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)
Expand Down Expand Up @@ -89,6 +91,6 @@ public ActionResult<ResponseWithStrEnum> GetFromQuery([FromQuery] Sport[] sports

## License

Copyright &copy; 2022 [Dmitry Khmara](https://dmitrykhmara.com).
Copyright &copy; 2025 [Dmytro Khmara](https://dmytrokhmara.com).

StrEnum is licensed under the [MIT license](LICENSE.txt).
8 changes: 4 additions & 4 deletions src/StrEnum.AspNetCore/StrEnum.AspNetCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
<PropertyGroup>
<PackageId>StrEnum.AspNetCore</PackageId>
<Description>String enum support for ASP.NET Core.</Description>
<Authors>Dmitry Khmara</Authors>
<Copyright>Copyright Dmitry Khmara</Copyright>
<Authors>Dmytro Khmara</Authors>
<Copyright>Copyright Dmytro Khmara</Copyright>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>StringEnum;String;Enum;ASP.NET Core</PackageTags>
<PackageIcon>icon.png</PackageIcon>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/StrEnum/StrEnum</RepositoryUrl>

<TargetFrameworks>netcoreapp3.1;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>10.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="StrEnum" Version="[2.0.0,3.0.0)" />
<PackageReference Include="StrEnum.System.Text.Json" Version="[2.1.1,3.0.0)" />
<PackageReference Include="StrEnum.System.Text.Json" Version="[2.1.1,10.0.0)" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.6.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="FluentAssertions" Version="8.4.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.6" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.0">
<PackageReference Include="coverlet.collector" Version="6.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Loading