Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
<MicrosoftExtensionsFileProvidersPhysicalPackageVersion>6.0.0</MicrosoftExtensionsFileProvidersPhysicalPackageVersion>
<NewtonsoftJsonPackageVersion>13.0.1</NewtonsoftJsonPackageVersion>
<NuGetPackagingVersion>6.3.1</NuGetPackagingVersion>
<HumanizerPackageVersion>2.14.1</HumanizerPackageVersion>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Everything below here are Packages only used by test projects -->
<!-- Microsoft.AspNetCore.Server.Kestrel -->
Expand Down
2 changes: 1 addition & 1 deletion scripts/install-aspnet-codegenerator.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set VERSION=6.0.13
set VERSION=6.0.14
set DEFAULT_NUPKG_PATH=%userprofile%\.nuget\packages
set SRC_DIR=%cd%
set NUPKG=artifacts/packages/Debug/Shipping/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}";
Expand Down Expand Up @@ -75,7 +76,7 @@ public static class @endPointsClassName

routes.MapPost("@routePrefix/", (@modelName model) =>
{
//return Results.Created($"/@pluralModel/{model.ID}", model);
//return Results.Created($"@routePrefixPlural/{model.ID}", model);
})
@{
if(Model.OpenAPI)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}";
Expand Down Expand Up @@ -66,7 +67,7 @@

routes.MapPost("@routePrefix/", (@modelName model) =>
{
//return Results.Created($"/@pluralModel/{model.ID}", model);
//return Results.Created($"/@routePrefixPlural/{model.ID}", model);
})
@{
if(Model.OpenAPI)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic.Features" Version="$(CodeAnalysisVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="$(CodeAnalysisVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="$(CodeAnalysisVersion)" />


<PackageReference Include="Humanizer" Version="$(HumanizerPackageVersion)"/>
<PackageReference Include="NuGet.ProjectModel" Version="$(NuGetProjectModelVersion)" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -14,6 +15,8 @@ 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.
Expand Down
1 change: 0 additions & 1 deletion test/Scaffolding/E2E_Test/E2E_Test.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="$(MicrosoftExtensionsFileProvidersPhysicalPackageVersion)" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
<!-- Restore this package as part of build so it's available for test projects -->
<PackageReference Include="Microsoft.NET.Sdk.Razor" Version="$(MicrosoftNETSdkRazorPackageVersion)" PrivateAssets="All" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="$(RepoRoot)test\Scaffolding\TestPackage.props" />

<PropertyGroup>
Expand All @@ -22,10 +22,9 @@
<Link>MsBuildSources\%(RecursiveDir)%(FileName)</Link>
</Compile>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Build.Runtime" Version="$(MicrosoftBuildRuntimePackageVersion)" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="$(MicrosoftExtensionsFileProvidersPhysicalPackageVersion)" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" PrivateAssets="All"/>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="$(MicrosoftExtensionsFileProvidersPhysicalPackageVersion)" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
</ItemGroup>

</Project>