diff --git a/Directory.Build.props b/Directory.Build.props
index bef7b8f8e..50d8376d9 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -22,11 +22,4 @@
Microsoft ASP.NET Core
-
-
-
-
-
-
-
diff --git a/eng/Versions.props b/eng/Versions.props
index f84e6a9bb..0575fce7a 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -17,32 +17,10 @@
7.0.6
7.0.6
-
-
-
-
7.0.6
-
-
-
-
-
-
-
-
-
-
7.0.6
-
-
-
-
-
-
-
-
7.0.6
@@ -51,7 +29,7 @@
7.0.6
- 7.0.6
+ 7.0.7
rtm
False
true
@@ -83,6 +61,7 @@
7.0.0
13.0.1
6.3.1
+ 2.14.1
@@ -135,12 +114,7 @@
2.4.2
2.4.2
-
- 4.3.4
- 4.3.2
- 4.3.0
- 6.0.0
-
+
1.5.0
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 daf359683..32383ccd4 100644
--- a/src/Scaffolding/VS.Web.CG.Mvc/Templates/MinimalApi/MinimalApi.cshtml
+++ b/src/Scaffolding/VS.Web.CG.Mvc/Templates/MinimalApi/MinimalApi.cshtml
@@ -6,7 +6,8 @@
string routePrefix = "/api/" + modelName;
string endPointsClassName = Model.EndpointsName;
string methodName = $"Map{@modelName}Endpoints";
- string pluralModel = $"{@modelName}s";
+ 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/MinimalApiEf.cshtml b/src/Scaffolding/VS.Web.CG.Mvc/Templates/MinimalApi/MinimalApiEf.cshtml
index a0ea6cb63..97d7d21f8 100644
--- a/src/Scaffolding/VS.Web.CG.Mvc/Templates/MinimalApi/MinimalApiEf.cshtml
+++ b/src/Scaffolding/VS.Web.CG.Mvc/Templates/MinimalApi/MinimalApiEf.cshtml
@@ -5,7 +5,7 @@
string routePrefix = "/api/" + modelName;
string endPointsClassName = Model.EndpointsName;
string methodName = $"Map{@modelName}Endpoints";
- string pluralModel = $"{@modelName}s";
+ string pluralModel = Model.ModelType.PluralName;
string getAllModels = $"GetAll{@pluralModel}";
string getModelById = $"Get{@modelName}ById";
string deleteModel = $"Delete{@modelName}";
diff --git a/src/Scaffolding/VS.Web.CG.Mvc/Templates/MinimalApi/MinimalApiEfNoClass.cshtml b/src/Scaffolding/VS.Web.CG.Mvc/Templates/MinimalApi/MinimalApiEfNoClass.cshtml
index 7635a034c..ed57f8b59 100644
--- a/src/Scaffolding/VS.Web.CG.Mvc/Templates/MinimalApi/MinimalApiEfNoClass.cshtml
+++ b/src/Scaffolding/VS.Web.CG.Mvc/Templates/MinimalApi/MinimalApiEfNoClass.cshtml
@@ -4,7 +4,7 @@
string routePrefix = "/api/" + modelName;
string endPointsClassName = Model.EndpointsName;
string methodName = $"Map{@modelName}Endpoints";
- string pluralModel = $"{@modelName}s";
+ string pluralModel = Model.ModelType.PluralName;
string getAllModels = $"GetAll{@pluralModel}";
string getModelById = $"Get{@modelName}ById";
string deleteModel = $"Delete{@modelName}";
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 b3e269d45..daaced82c 100644
--- a/src/Scaffolding/VS.Web.CG.Mvc/Templates/MinimalApi/MinimalApiNoClass.cshtml
+++ b/src/Scaffolding/VS.Web.CG.Mvc/Templates/MinimalApi/MinimalApiNoClass.cshtml
@@ -6,7 +6,8 @@
string routePrefix = "/api/" + modelName;
string endPointsClassName = Model.EndpointsName;
string methodName = $"Map{@modelName}Endpoints";
- string pluralModel = $"{@modelName}s";
+ 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);
}
}
})
diff --git a/src/Shared/Microsoft.DotNet.Scaffolding.Shared/Microsoft.DotNet.Scaffolding.Shared.csproj b/src/Shared/Microsoft.DotNet.Scaffolding.Shared/Microsoft.DotNet.Scaffolding.Shared.csproj
index 834442257..71c8e3bf1 100644
--- a/src/Shared/Microsoft.DotNet.Scaffolding.Shared/Microsoft.DotNet.Scaffolding.Shared.csproj
+++ b/src/Shared/Microsoft.DotNet.Scaffolding.Shared/Microsoft.DotNet.Scaffolding.Shared.csproj
@@ -16,17 +16,10 @@
-
-
-
-
-
-
-
-
+
-
+
True
@@ -41,5 +34,5 @@
MessageStrings.Designer.cs
-
+
diff --git a/src/Shared/Microsoft.DotNet.Scaffolding.Shared/Project/ModelType.cs b/src/Shared/Microsoft.DotNet.Scaffolding.Shared/Project/ModelType.cs
index b4a610418..4faed9430 100644
--- a/src/Shared/Microsoft.DotNet.Scaffolding.Shared/Project/ModelType.cs
+++ b/src/Shared/Microsoft.DotNet.Scaffolding.Shared/Project/ModelType.cs
@@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System;
+using Humanizer;
using Microsoft.CodeAnalysis;
namespace Microsoft.DotNet.Scaffolding.Shared.Project
@@ -14,6 +15,7 @@ public class ModelType
public string FullName { get; set; }
+ public string PluralName => Name?.Pluralize(inputIsKnownToBeSingular: false);
// Violating the principle that ModelType should be decoupled from Roslyn's API.
// I had to do this for editing DbContext scenarios but I need to figure out if there
// is a better way.
diff --git a/test/Directory.Build.props b/test/Directory.Build.props
index 40ac2764e..f33bdc0ea 100644
--- a/test/Directory.Build.props
+++ b/test/Directory.Build.props
@@ -11,7 +11,6 @@
-
diff --git a/test/Scaffolding/Shared/MSBuildProjectStrings.cs b/test/Scaffolding/Shared/MSBuildProjectStrings.cs
index 477e8dcaa..8ebb6e9e4 100644
--- a/test/Scaffolding/Shared/MSBuildProjectStrings.cs
+++ b/test/Scaffolding/Shared/MSBuildProjectStrings.cs
@@ -895,7 +895,7 @@ public static IWebHost BuildWebHost(string[] args) =>
- https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json;
+ https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json;
net7.0
enable
@@ -905,13 +905,13 @@ public static IWebHost BuildWebHost(string[] args) =>
-
-
+
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
-
+
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
@@ -923,7 +923,7 @@ public static IWebHost BuildWebHost(string[] args) =>
- https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json;
+ https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json;
net7.0
Microsoft.Test
@@ -932,7 +932,7 @@ public static IWebHost BuildWebHost(string[] args) =>
-
+
";
@@ -942,7 +942,7 @@ public static IWebHost BuildWebHost(string[] args) =>
- https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json;
+ https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json;
net7.0
enable
@@ -950,7 +950,7 @@ public static IWebHost BuildWebHost(string[] args) =>
-
+
diff --git a/test/Scaffolding/VS.Web.CG.MSBuild.Test/VS.Web.CG.MSBuild.Tests.csproj b/test/Scaffolding/VS.Web.CG.MSBuild.Test/VS.Web.CG.MSBuild.Tests.csproj
index f65222fe9..d53e8c26c 100644
--- a/test/Scaffolding/VS.Web.CG.MSBuild.Test/VS.Web.CG.MSBuild.Tests.csproj
+++ b/test/Scaffolding/VS.Web.CG.MSBuild.Test/VS.Web.CG.MSBuild.Tests.csproj
@@ -1,5 +1,5 @@
-
+
@@ -22,9 +22,10 @@
MsBuildSources\%(RecursiveDir)%(FileName)
-
+
+
diff --git a/tools/dotnet-aspnet-codegenerator/dotnet-aspnet-codegenerator.csproj b/tools/dotnet-aspnet-codegenerator/dotnet-aspnet-codegenerator.csproj
index c2d09fbc0..e8c2f7d74 100644
--- a/tools/dotnet-aspnet-codegenerator/dotnet-aspnet-codegenerator.csproj
+++ b/tools/dotnet-aspnet-codegenerator/dotnet-aspnet-codegenerator.csproj
@@ -27,7 +27,6 @@
-