aspnetcore/fundamentals/aot/request-delegate-generator/diagnostics/rdg012.md
| Value | |
|---|---|
| Rule ID | RDG012 |
| 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 without the appropriate accessibility modifiers.
Endpoints that use an inaccessible type (private or protected) are not supported.
The endpoints within MapEndpoints produce this diagnostic because of the Todo type has the private accessibility modifiers.
:::code language="csharp" source="~/../AspNetCore.Docs.Samples/fundamentals/aot/diagnostics/Rdg12/Program.cs" id="snippet_1" highlight="16-27, 29":::
When applicable, set the target parameter type with a friendly accessibility.
:::code language="csharp" source="~/../AspNetCore.Docs.Samples/fundamentals/aot/diagnostics/Rdg12/Program.cs" id="snippet_1f" highlight="17-28, 30":::
This warning can be safely suppressed. When suppressed, the framework will fallback to generating the request delegate at runtime.