File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
aspnetcore/fundamentals/minimal-apis Expand file tree Collapse file tree 2 files changed +16
-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 @@ -140,12 +140,20 @@ The following sections demonstrate the usage of the common result helpers.
140140
141141:::code language="csharp" source="~ /fundamentals/minimal-apis/9.0-samples/Snippets/Program.cs" id="snippet_06":::
142142
143+ :::moniker range=">= aspnetcore-9.0"
144+
143145#### Internal Server Error
144146
145147:::code language="csharp" source="~ /fundamentals/minimal-apis/9.0-samples/Snippets/Program.cs" id="snippet_07":::
146148
147149The preceding example returns a 500 status code.
148150
151+ #### Problem and ValidationProblem
152+
153+ :::code language="csharp" source="~ /fundamentals/minimal-apis/9.0-samples/Snippets/Program.cs" id="snippet_12":::
154+
155+ ::: moniker-end
156+
149157#### Text
150158
151159:::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