dotnet / dotnet/aspnetcore

Endpoint filter factory was called twice.

Open
#59,562 2 comments 0 reactions 0 assignees View on GitHub
area-minimal
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

Minimal-API's endpoint filter factory was called twice.

### Expected Behavior

Minimal-API's endpoint filter factory was called once.

### Steps To Reproduce

``` csharp
app.MapGet("/api/a", () => { })
.AddEndpointFilterFactory((ctx, next) =>
{
ctx.ApplicationServices.GetService>()!.LogError("Enter!!!!!!!!!!!!");
return (ctxf) => next(ctxf);
});
```

![Image](https://github.com/user-attachments/assets/4f9d04d5-7519-4b42-97c1-61b0f4b70d01)

### Exceptions (if any)

_No response_

### .NET Version

_No response_

### Anything else?

- ASP.NET Core version: 8.0 and 9.0.
- VS version: 17.12.1

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.