aspnetcore/fundamentals/aot/request-delegate-generator/diagnostics/rdg008.md
| Value | |
|---|---|
| Rule ID | RDG008 |
| Fix is breaking or non-breaking | Non-breaking |
This diagnostic is emitted by the Request Delegate Generator when an endpoint contains a route handler with a parameter annotated with the [AsParameters] attribute with multiple public constructors.
Types that are used for surrogate binding via the AsParameters attribute must contain a single public constructor. The TodoRequest type produces this diagnostic because there are multiple public constructors.
:::code language="csharp" source="~/../AspNetCore.Docs.Samples/fundamentals/aot/diagnostics/Rdg8/Program.cs" id="snippet_1" highlight="17,32-43":::
Provide a single public constructor.
:::code language="csharp" source="~/../AspNetCore.Docs.Samples/fundamentals/aot/diagnostics/Rdg8/Program.cs" id="snippet_1f" highlight="17,45":::
This warning can be safely suppressed.