diff --git a/src/Scaffolding/VS.Web.CG.Mvc/Templates/MinimalApi/MinimalApi.cshtml b/src/Scaffolding/VS.Web.CG.Mvc/Templates/MinimalApi/MinimalApi.cshtml index 828c2c89e..32383ccd4 100644 --- a/src/Scaffolding/VS.Web.CG.Mvc/Templates/MinimalApi/MinimalApi.cshtml +++ b/src/Scaffolding/VS.Web.CG.Mvc/Templates/MinimalApi/MinimalApi.cshtml @@ -7,6 +7,7 @@ string endPointsClassName = Model.EndpointsName; string methodName = $"Map{@modelName}Endpoints"; string pluralModel = Model.ModelType.PluralName; + string routePrefixPlural = "/api/" + pluralModel; string getAllModels = $"GetAll{@pluralModel}"; string getModelById = $"Get{@modelName}ById"; string deleteModel = $"Delete{@modelName}"; @@ -94,11 +95,11 @@ public static class @endPointsClassName @{ if(!Model.UseTypedResults) { - @://return Results.Created($"/@pluralModel/{model.ID}", model); + @://return Results.Created($"@routePrefixPlural/{model.ID}", model); } else { - @://return TypedResults.Created($"/@pluralModel/{model.ID}", model); + @://return TypedResults.Created($"@routePrefixPlural/{model.ID}", model); } } }) diff --git a/src/Scaffolding/VS.Web.CG.Mvc/Templates/MinimalApi/MinimalApiNoClass.cshtml b/src/Scaffolding/VS.Web.CG.Mvc/Templates/MinimalApi/MinimalApiNoClass.cshtml index bb2cd5d28..daaced82c 100644 --- a/src/Scaffolding/VS.Web.CG.Mvc/Templates/MinimalApi/MinimalApiNoClass.cshtml +++ b/src/Scaffolding/VS.Web.CG.Mvc/Templates/MinimalApi/MinimalApiNoClass.cshtml @@ -7,6 +7,7 @@ string endPointsClassName = Model.EndpointsName; string methodName = $"Map{@modelName}Endpoints"; string pluralModel = Model.ModelType.PluralName; + string routePrefixPlural = "/api/" + pluralModel; string getAllModels = $"GetAll{@pluralModel}"; string getModelById = $"Get{@modelName}ById"; string deleteModel = $"Delete{@modelName}"; @@ -85,11 +86,11 @@ @{ if(!Model.UseTypedResults) { - @://return Results.Created($"/@pluralModel/{model.ID}", model); + @://return Results.Created($"@routePrefixPlural/{model.ID}", model); } else { - @://return TypedResults.Created($"/@pluralModel/{model.ID}", model); + @://return TypedResults.Created($"@routePrefixPlural/{model.ID}", model); } } })