dotnet / dotnet/aspnetcore

Support localization for endpoint attributes

Open
#40,150 2 comments 1 reaction 0 assignees View on GitHub
area-minimal enhancement feature-minimal-actions
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

Minimal APIs leans heavily into endpoint metadata for providing annotations to endpoints. This metadata can be populated onto an endpoint via extension methods or attributes.

```csharp
app.MapGet("/foo", [Tags("just", "some", "tags")] () => { ... })
.WithName("name");
```

When extension methods are used, the contents of the metadata can be localized using the standard IStringLocalizer experience. The same is not possible with attributes due to limitations with the parameters that can be used to initialize an attribute.

MVC supports localization of DataAnnotation attributes through some ✨ fanciness ✨ that we may consider replicating for minimal APIs.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.