File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
aspnetcore/fundamentals/minimal-apis Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,14 @@ public static void Main(string[] args)
4646 // <snippet_10>
4747 app . MapGet ( "/download" , ( ) => Results . File ( "myfile.text" ) ) ;
4848 // </snippet_10>
49-
49+ // <snippet_12>
50+ app . MapGet ( "/problem" , ( ) =>
51+ {
52+ var extensions = new List < KeyValuePair < string , object ? > > { new ( "test" , "value" ) } ;
53+ return TypedResults . Problem ( "This is an error with extensions" ,
54+ extensions : extensions ) ;
55+ } ) ;
56+ // </snippet_12>
5057 app . Run ( ) ;
5158 }
5259 // <snippet_11>
Original file line number Diff line number Diff line change @@ -146,6 +146,10 @@ The following sections demonstrate the usage of the common result helpers.
146146
147147The preceding example returns a 500 status code.
148148
149+ #### Problem and ValidationProblem
150+
151+ :::code language="csharp" source="~ /fundamentals/minimal-apis/9.0-samples/Snippets/Program.cs" id="snippet_12":::
152+
149153#### Text
150154
151155:::code language="csharp" source="~ /fundamentals/minimal-apis/9.0-samples/Snippets/Program.cs" id="snippet_08":::
You can’t perform that action at this time.
0 commit comments