Skip to content

Commit

Permalink
7.0.7 servicing (#2406)
Browse files Browse the repository at this point in the history
* pluralizing model name in minimalapi scenarios using humanizer (#2401)

* update version

* removing extra, unneeded PackageReferences

* corrected api route for some minimal api scenarios (#2403)

* removed unnecessary assemblies (#2405)

* removed unneccessary assemblies

* minor fix with test projects.
  • Loading branch information
deepchoudhery authored May 12, 2023
1 parent 759f2f4 commit bb3500a
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 67 deletions.
7 changes: 0 additions & 7 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,4 @@
<Product>Microsoft ASP.NET Core</Product>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Private.Uri" Version="$(SystemPrivateUriVersion)" />
<PackageReference Include="System.Security.Cryptography.X509Certificates" Version="$(SystemSecurityCryptographyX509CertificatesVersion)"/>
<PackageReference Include="System.Configuration.ConfigurationManager" Version="$(SystemConfigurationConfigurationManager)"/>
<PackageReference Include="NuGet.Packaging" Version="$(NuGetPackagingVersion)" />
</ItemGroup>

</Project>
32 changes: 3 additions & 29 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,10 @@
<MicrosoftEntityFrameworkCorePackageVersion>7.0.6</MicrosoftEntityFrameworkCorePackageVersion>
<!-- Microsoft.EntityFrameworkCore.SqlServer -->
<MicrosoftEntityFrameworkCoreSqlServerPackageVersion>7.0.6</MicrosoftEntityFrameworkCoreSqlServerPackageVersion>
<MicrosoftExtensionsDependencyInjectionPackageVersion>
</MicrosoftExtensionsDependencyInjectionPackageVersion>
<MicrosoftExtensionsFileProvidersPhysicalPackageVersion>
</MicrosoftExtensionsFileProvidersPhysicalPackageVersion>
<!-- Microsoft.Extensions.Identity.Stores -->
<MicrosoftExtensionsIdentityStoresPackageVersion>7.0.6</MicrosoftExtensionsIdentityStoresPackageVersion>
<MicrosoftExtensionsConfigurationAbstractionsPackageVersion>
</MicrosoftExtensionsConfigurationAbstractionsPackageVersion>
<MicrosoftExtensionsConfigurationEnvironmentVariablesPackageVersion>
</MicrosoftExtensionsConfigurationEnvironmentVariablesPackageVersion>
<MicrosoftExtensionsConfigurationJsonPackageVersion>
</MicrosoftExtensionsConfigurationJsonPackageVersion>
<MicrosoftExtensionsConfigurationUserSecretsPackageVersion>
</MicrosoftExtensionsConfigurationUserSecretsPackageVersion>
<MicrosoftExtensionsDependencyModelPackageVersion>
</MicrosoftExtensionsDependencyModelPackageVersion>
<!-- Microsoft.Extensions.FileProviders.Embedded -->
<MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>7.0.6</MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>
<MicrosoftExtensionsLoggingConsolePackageVersion>
</MicrosoftExtensionsLoggingConsolePackageVersion>
<MicrosoftExtensionsLoggingDebugPackageVersion>
</MicrosoftExtensionsLoggingDebugPackageVersion>
<MicrosoftExtensionsLoggingPackageVersion>
</MicrosoftExtensionsLoggingPackageVersion>
<MicrosoftExtensionsOptionsConfigurationExtensionsPackageVersion>
</MicrosoftExtensionsOptionsConfigurationExtensionsPackageVersion>
<!-- Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore -->
<MicrosoftAspNetCoreDiagnosticsEntityFrameworkCorePackageVersion>7.0.6</MicrosoftAspNetCoreDiagnosticsEntityFrameworkCorePackageVersion>
<!-- Microsoft.AspNetCore.Identity.EntityFrameworkCore -->
Expand All @@ -51,7 +29,7 @@
<MicrosoftAspNetCoreIdentityUIPackageVersion>7.0.6</MicrosoftAspNetCoreIdentityUIPackageVersion>
</PropertyGroup>
<PropertyGroup>
<VersionPrefix>7.0.6</VersionPrefix>
<VersionPrefix>7.0.7</VersionPrefix>
<PreReleaseVersionLabel>rtm</PreReleaseVersionLabel>
<IncludeSourceRevisionInInformationalVersion>False</IncludeSourceRevisionInInformationalVersion>
<IsServicingBuild Condition="'$(PreReleaseVersionLabel)' == 'servicing'">true</IsServicingBuild>
Expand Down Expand Up @@ -83,6 +61,7 @@
<MicrosoftExtensionsFileProvidersPhysicalPackageVersion>7.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 Expand Up @@ -135,12 +114,7 @@
<XunitExtensibilityExecutionPackageVersion>2.4.2</XunitExtensibilityExecutionPackageVersion>
<XunitRunnerVisualStudioPackageVersion>2.4.2</XunitRunnerVisualStudioPackageVersion>
</PropertyGroup>
<PropertyGroup>
<SystemNetHttpVersion>4.3.4</SystemNetHttpVersion>
<SystemPrivateUriVersion>4.3.2</SystemPrivateUriVersion>
<SystemSecurityCryptographyX509CertificatesVersion>4.3.0</SystemSecurityCryptographyX509CertificatesVersion>
<SystemConfigurationConfigurationManager>6.0.0</SystemConfigurationConfigurationManager>
</PropertyGroup>

<!-- Package versions for MSIdentity projects-->
<PropertyGroup>
<AzureIdentityVersion>1.5.0</AzureIdentityVersion>
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 @@ -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);
}
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}";
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 @@ -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);
}
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,10 @@
<!-- Packages for CodeAnalysis code changes-->
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Features" Version="$(CodeAnalysisVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="$(CodeAnalysisVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="$(CodeAnalysisVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.Features" Version="$(CodeAnalysisVersion)" />
<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>

<ItemGroup>
<Compile Update="MessageStrings.Designer.cs">
<DesignTime>True</DesignTime>
Expand All @@ -41,5 +34,5 @@
<LastGenOutput>MessageStrings.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>

</Project>
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,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.
Expand Down
1 change: 0 additions & 1 deletion test/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<PackageReference Include="xunit.extensibility.execution" Version="$(XunitExtensibilityExecutionPackageVersion)" />
<PackageReference Include="xunit.skippablefact" Version="$(XunitSkippableFactPackageVersion)" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="$(MicrosoftExtensionsDependencyModelPackageVersion)" />
<PackageReference Include="System.Net.Http" Version="$(SystemNetHttpVersion)" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
</ItemGroup>
</Project>
18 changes: 9 additions & 9 deletions test/Scaffolding/Shared/MSBuildProjectStrings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ public static IWebHost BuildWebHost(string[] args) =>
<Import Project=""$(MSBuildThisFileDirectory)\TestCodeGeneration.targets"" />
<PropertyGroup>
<RestoreSources>
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;
</RestoreSources>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
Expand All @@ -905,13 +905,13 @@ public static IWebHost BuildWebHost(string[] args) =>
</PropertyGroup>
<ItemGroup>
<PackageReference Include=""Microsoft.VisualStudio.Web.CodeGeneration.Design"" Version=""7.0.0-rtm.22528.4"" />
<PackageReference Include=""Microsoft.EntityFrameworkCore.Design"" Version=""7.0.0-preview.1.22076.6"">
<PackageReference Include=""Microsoft.VisualStudio.Web.CodeGeneration.Design"" Version=""7.0.6""/>
<PackageReference Include=""Microsoft.EntityFrameworkCore.Design"" Version=""7.0.5""/>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include = ""Microsoft.EntityFrameworkCore.SqlServer"" Version=""7.0.0-preview.1.22076.6"" />
<PackageReference Include = ""Microsoft.EntityFrameworkCore.Tools"" Version=""7.0.0-preview.1.22076.6"">
<PackageReference Include = ""Microsoft.EntityFrameworkCore.SqlServer"" Version=""7.0.5""/>
<PackageReference Include = ""Microsoft.EntityFrameworkCore.Tools"" Version=""7.0.5"">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand All @@ -923,7 +923,7 @@ public static IWebHost BuildWebHost(string[] args) =>
<Import Project=""$(MSBuildThisFileDirectory)\TestCodeGeneration.targets"" />
<PropertyGroup>
<RestoreSources>
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;
</RestoreSources>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>Microsoft.Test</RootNamespace>
Expand All @@ -932,7 +932,7 @@ public static IWebHost BuildWebHost(string[] args) =>
</PropertyGroup>
<ItemGroup>
<PackageReference Include=""Microsoft.VisualStudio.Web.CodeGeneration.Design"" Version=""7.0.0-rtm.22528.4"" />
<PackageReference Include=""Microsoft.VisualStudio.Web.CodeGeneration.Design"" Version=""7.0.6"" />
</ItemGroup>
</Project>
";
Expand All @@ -942,15 +942,15 @@ public static IWebHost BuildWebHost(string[] args) =>
<Import Project=""$(MSBuildThisFileDirectory)\TestCodeGeneration.targets"" />
<PropertyGroup>
<RestoreSources>
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;
</RestoreSources>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include=""Microsoft.VisualStudio.Web.CodeGeneration.Design"" Version=""7.0.0-rtm.22528.4"" />
<PackageReference Include=""Microsoft.VisualStudio.Web.CodeGeneration.Design"" Version=""7.0.6"" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include=""..\Library\Library.csproj"" />
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,9 +22,10 @@
<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="NuGet.Packaging" Version="$(NuGetPackagingVersion)" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

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

Expand Down

0 comments on commit bb3500a

Please sign in to comment.