From 62edb4c2518f45ad09411b3f1f22b5433394d191 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Wed, 1 Nov 2023 15:59:49 -1000 Subject: [PATCH] fix RDG9 /8 (#30906) * fix RDG9 /8 * fix RDG9 /8 * fix RDG9 /8 * fix RDG9 /8 * fix RDG9 /8 * fix RDG9 /8 * fix RDG9 /8 --- .../diagnostics/rdg009.md | 24 +++++-------------- aspnetcore/toc.yml | 2 ++ 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/aspnetcore/fundamentals/aot/request-delegate-generator/diagnostics/rdg009.md b/aspnetcore/fundamentals/aot/request-delegate-generator/diagnostics/rdg009.md index fe18bc31a0..c96e17c055 100644 --- a/aspnetcore/fundamentals/aot/request-delegate-generator/diagnostics/rdg009.md +++ b/aspnetcore/fundamentals/aot/request-delegate-generator/diagnostics/rdg009.md @@ -4,7 +4,7 @@ description: "Learn about analysis rule RDG009: Invalid nested AsParameters" author: captainsafia monikerRange: '>= aspnetcore-8.0' ms.author: safia -ms.date: 9/15/2023 +ms.date: 11/1/2023 uid: fundamentals/aot/request-delegate-generator/diagnostics/rdg009 --- # RDG009: Invalid nested AsParameters @@ -20,27 +20,15 @@ This diagnostic is emitted by the [Request Delegate Generator](/aspnet/core/fund ### Rule description -Types that are used for surrogate binding via the [`[AsParameters]`](xref:Microsoft.AspNetCore.Http.AsParametersAttribute) attribute must not contain nested types that are also annotated with the [`[AsParameters]`](xref:Microsoft.AspNetCore.Http.AsParametersAttribute) attribute. +Types that are used for surrogate binding via the [`[AsParameters]`](xref:Microsoft.AspNetCore.Http.AsParametersAttribute) attribute must not contain nested types that are also annotated with the [`[AsParameters]`](xref:Microsoft.AspNetCore.Http.AsParametersAttribute) attribute: - +:::code language="csharp" source="~/../AspNetCore.Docs.Samples/fundamentals/aot/diagnostics/Rdg9/Program.cs" id="snippet_1f" highlight="19,31"::: ## How to fix violations -Remove the nested nested `AsParameters` attribute. +Remove the nested nested `AsParameters` attribute: + +:::code language="csharp" source="~/../AspNetCore.Docs.Samples/fundamentals/aot/diagnostics/Rdg9/Program.cs" id="snippet_1" highlight="17,29"::: ## When to suppress warnings diff --git a/aspnetcore/toc.yml b/aspnetcore/toc.yml index e048ecb780..953362d93b 100644 --- a/aspnetcore/toc.yml +++ b/aspnetcore/toc.yml @@ -245,6 +245,8 @@ items: uid: fundamentals/aot/request-delegate-generator/diagnostics/rdg007 - name: RDG008 uid: fundamentals/aot/request-delegate-generator/diagnostics/rdg008 + - name: RDG009 + uid: fundamentals/aot/request-delegate-generator/diagnostics/rdg009 - name: RDG010 uid: fundamentals/aot/request-delegate-generator/diagnostics/rdg010 - name: RDG011