File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
src/ProjectTemplates/Web.ProjectTemplates/content/WebApiAot-CSharp Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 11using System . Text . Json . Serialization ;
2+ using Microsoft . AspNetCore . Http ;
3+ using Microsoft . AspNetCore . Http . HttpResults ;
24
35namespace Company . WebApplication1 ;
46
@@ -24,7 +26,7 @@ public static void Main(string[] args)
2426 } ;
2527
2628 var todosApi = app . MapGroup ( "/todos" ) ;
27- #if ( EnableOpenAPI )
29+ #if ( EnableOpenAPI )
2830 todosApi . MapGet ( "/" , ( ) => sampleTodos )
2931 . WithName ( "GetTodos" ) ;
3032
@@ -33,14 +35,14 @@ public static void Main(string[] args)
3335 ? TypedResults . Ok ( todo )
3436 : TypedResults . NotFound ( ) )
3537 . WithName ( "GetTodoById" ) ;
36- #else
38+ #else
3739 todosApi . MapGet ( "/" , ( ) => sampleTodos ) ;
3840
3941 todosApi . MapGet ( "/{id}" , Results < Ok < Todo > , NotFound > ( int id ) =>
4042 sampleTodos . FirstOrDefault ( a => a . Id == id ) is { } todo
4143 ? TypedResults . Ok ( todo )
4244 : TypedResults . NotFound ( ) ) ;
43- #endif
45+ #endif
4446
4547 app . Run ( ) ;
4648 }
Original file line number Diff line number Diff line change 11using System . Text . Json . Serialization ;
2+ using Microsoft . AspNetCore . Http ;
3+ using Microsoft . AspNetCore . Http . HttpResults ;
24
35var builder = WebApplication . CreateSlimBuilder ( args ) ;
46
You can’t perform that action at this time.
0 commit comments