Skip to content

Commit 5ae1121

Browse files
flipping the results type in template (#2153)
1 parent 6a425ce commit 5ae1121

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/Scaffolding/VS.Web.CG.Mvc/Templates/MinimalApi/MinimalApi.cshtml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ public static class @endPointsClassName
9494
@{
9595
if(!Model.UseTypedResults)
9696
{
97-
@://return TypedResults.Created($"/@pluralModel/{model.ID}", model);
97+
@://return Results.Created($"/@pluralModel/{model.ID}", model);
9898
}
9999
else
100100
{
101-
@://return Results.Created($"/@pluralModel/{model.ID}", model);
101+
@://return TypedResults.Created($"/@pluralModel/{model.ID}", model);
102102
}
103103
}
104104
})
@@ -120,11 +120,11 @@ public static class @endPointsClassName
120120
@{
121121
if(!Model.UseTypedResults)
122122
{
123-
@://return TypedResults.Ok(new @modelName { ID = id });
123+
@://return Results.Ok(new @modelName { ID = id });
124124
}
125125
else
126126
{
127-
@://return Results.Ok(new @modelName { ID = id });
127+
@://return TypedResults.Ok(new @modelName { ID = id });
128128
}
129129
}
130130
})

src/Scaffolding/VS.Web.CG.Mvc/Templates/MinimalApi/MinimalApiNoClass.cshtml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@
8585
@{
8686
if(!Model.UseTypedResults)
8787
{
88-
@://return TypedResults.Created($"/@pluralModel/{model.ID}", model);
88+
@://return Results.Created($"/@pluralModel/{model.ID}", model);
8989
}
9090
else
9191
{
92-
@://return Results.Created($"/@pluralModel/{model.ID}", model);
92+
@://return TypedResults.Created($"/@pluralModel/{model.ID}", model);
9393
}
9494
}
9595
})
@@ -111,11 +111,11 @@
111111
@{
112112
if(!Model.UseTypedResults)
113113
{
114-
@://return TypedResults.Ok(new @modelName { ID = id });
114+
@://return Results.Ok(new @modelName { ID = id });
115115
}
116116
else
117117
{
118-
@://return Results.Ok(new @modelName { ID = id });
118+
@://return TypedResults.Ok(new @modelName { ID = id });
119119
}
120120
}
121121
})

0 commit comments

Comments
 (0)