File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
src/Scaffolding/VS.Web.CG.Mvc/Templates/MinimalApi Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 77 string endPointsClassName = Model .EndpointsName ;
88 string methodName = $" Map{@modelName }Endpoints" ;
99 string pluralModel = Model .ModelType .PluralName ;
10+ string routePrefixPlural = " /api/" + pluralModel ;
1011 string getAllModels = $" GetAll{@pluralModel }" ;
1112 string getModelById = $" Get{@modelName }ById" ;
1213 string deleteModel = $" Delete{@modelName }" ;
@@ -94,11 +95,11 @@ public static class @endPointsClassName
9495 @{
9596 if (! Model .UseTypedResults )
9697 {
97- @: // return Results.Created($"/@pluralModel /{model.ID}", model);
98+ @: // return Results.Created($"@routePrefixPlural /{model.ID}", model);
9899 }
99100 else
100101 {
101- @: // return TypedResults.Created($"/@pluralModel /{model.ID}", model);
102+ @: // return TypedResults.Created($"@routePrefixPlural /{model.ID}", model);
102103 }
103104 }
104105 })
Original file line number Diff line number Diff line change 77 string endPointsClassName = Model .EndpointsName ;
88 string methodName = $" Map{@modelName }Endpoints" ;
99 string pluralModel = Model .ModelType .PluralName ;
10+ string routePrefixPlural = " /api/" + pluralModel ;
1011 string getAllModels = $" GetAll{@pluralModel }" ;
1112 string getModelById = $" Get{@modelName }ById" ;
1213 string deleteModel = $" Delete{@modelName }" ;
8586 @{
8687 if (! Model .UseTypedResults )
8788 {
88- @: // return Results.Created($"/@pluralModel /{model.ID}", model);
89+ @: // return Results.Created($"@routePrefixPlural /{model.ID}", model);
8990 }
9091 else
9192 {
92- @: // return TypedResults.Created($"/@pluralModel /{model.ID}", model);
93+ @: // return TypedResults.Created($"@routePrefixPlural /{model.ID}", model);
9394 }
9495 }
9596 })
You can’t perform that action at this time.
0 commit comments