File tree Expand file tree Collapse file tree
Scaffolding/VS.Web.CG.Mvc/Templates/MinimalApi
Shared/Microsoft.DotNet.Scaffolding.Shared Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8383 <MicrosoftExtensionsFileProvidersPhysicalPackageVersion >7.0.0</MicrosoftExtensionsFileProvidersPhysicalPackageVersion >
8484 <NewtonsoftJsonPackageVersion >13.0.1</NewtonsoftJsonPackageVersion >
8585 <NuGetPackagingVersion >6.3.1</NuGetPackagingVersion >
86+ <HumanizerPackageVersion >2.14.1</HumanizerPackageVersion >
8687 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
8788 <!-- Everything below here are Packages only used by test projects -->
8889 <!-- Microsoft.AspNetCore.Server.Kestrel -->
Original file line number Diff line number Diff line change 66 string routePrefix = " /api/" + modelName ;
77 string endPointsClassName = Model .EndpointsName ;
88 string methodName = $" Map{@modelName }Endpoints" ;
9- string pluralModel = $" { @modelName }s " ;
9+ string pluralModel = Model . ModelType . PluralName ;
1010 string getAllModels = $" GetAll{@pluralModel }" ;
1111 string getModelById = $" Get{@modelName }ById" ;
1212 string deleteModel = $" Delete{@modelName }" ;
Original file line number Diff line number Diff line change 55 string routePrefix = " /api/" + modelName ;
66 string endPointsClassName = Model .EndpointsName ;
77 string methodName = $" Map{@modelName }Endpoints" ;
8- string pluralModel = $" { @modelName }s " ;
8+ string pluralModel = Model . ModelType . PluralName ;
99 string getAllModels = $" GetAll{@pluralModel }" ;
1010 string getModelById = $" Get{@modelName }ById" ;
1111 string deleteModel = $" Delete{@modelName }" ;
Original file line number Diff line number Diff line change 44 string routePrefix = " /api/" + modelName ;
55 string endPointsClassName = Model .EndpointsName ;
66 string methodName = $" Map{@modelName }Endpoints" ;
7- string pluralModel = $" { @modelName }s " ;
7+ string pluralModel = Model . ModelType . PluralName ;
88 string getAllModels = $" GetAll{@pluralModel }" ;
99 string getModelById = $" Get{@modelName }ById" ;
1010 string deleteModel = $" Delete{@modelName }" ;
Original file line number Diff line number Diff line change 66 string routePrefix = " /api/" + modelName ;
77 string endPointsClassName = Model .EndpointsName ;
88 string methodName = $" Map{@modelName }Endpoints" ;
9- string pluralModel = $" { @modelName }s " ;
9+ string pluralModel = Model . ModelType . PluralName ;
1010 string getAllModels = $" GetAll{@pluralModel }" ;
1111 string getModelById = $" Get{@modelName }ById" ;
1212 string deleteModel = $" Delete{@modelName }" ;
Original file line number Diff line number Diff line change 2222 <PackageReference Include =" Microsoft.CodeAnalysis.VisualBasic.Features" Version =" $(CodeAnalysisVersion)" />
2323 <PackageReference Include =" Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version =" $(CodeAnalysisVersion)" />
2424 <PackageReference Include =" Microsoft.CodeAnalysis.Workspaces.MSBuild" Version =" $(CodeAnalysisVersion)" />
25-
26-
25+ <PackageReference Include =" Humanizer" Version =" $(HumanizerPackageVersion)" />
2726 <PackageReference Include =" NuGet.ProjectModel" Version =" $(NuGetProjectModelVersion)" />
2827 </ItemGroup >
29-
28+
3029 <ItemGroup >
3130 <Compile Update =" MessageStrings.Designer.cs" >
3231 <DesignTime >True</DesignTime >
4140 <LastGenOutput >MessageStrings.Designer.cs</LastGenOutput >
4241 </EmbeddedResource >
4342 </ItemGroup >
44-
43+
4544</Project >
Original file line number Diff line number Diff line change 22// The .NET Foundation licenses this file to you under the MIT license.
33
44using System ;
5+ using Humanizer ;
56using Microsoft . CodeAnalysis ;
67
78namespace Microsoft . DotNet . Scaffolding . Shared . Project
@@ -14,6 +15,7 @@ public class ModelType
1415
1516 public string FullName { get ; set ; }
1617
18+ public string PluralName => Name ? . Pluralize ( inputIsKnownToBeSingular : false ) ;
1719 // Violating the principle that ModelType should be decoupled from Roslyn's API.
1820 // I had to do this for editing DbContext scenarios but I need to figure out if there
1921 // is a better way.
You can’t perform that action at this time.
0 commit comments