Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8b0a70d

Browse filesBrowse files
xavierjohncommonsensesoftware
authored andcommitted
If Controller Attribute is set, use it for the controller's name
1 parent 471eb04 commit 8b0a70d
Copy full SHA for 8b0a70d

File tree

Expand file treeCollapse file tree

4 files changed

+14
-3
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+14
-3
lines changed

‎.github/workflows/codeql-analysis.yml

Copy file name to clipboardExpand all lines: .github/workflows/codeql-analysis.yml
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,13 @@ jobs:
2929

3030
- name: Setup .NET
3131
uses: actions/setup-dotnet@v3
32+
id: installdotnet
3233
with:
3334
dotnet-version: 7.0.x
3435

36+
- name: Create temporary global.json
37+
run: echo '{"sdk":{"version":"${{ steps.installdotnet.outputs.dotnet-version }}"}}' > ./global.json
38+
3539
# build a temporary *.slnf file that only contains source projects and put it in ~/obj
3640
# so that it is not tracked by git. then run 'dotnet build' using the *.slnf, which
3741
# will preserve the dependency order and configuration of the *.sln

‎src/AspNetCore/WebApi/src/Asp.Versioning.Mvc/ApiVersioningApplicationModelProvider.cs

Copy file name to clipboardExpand all lines: src/AspNetCore/WebApi/src/Asp.Versioning.Mvc/ApiVersioningApplicationModelProvider.cs
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,14 @@ public virtual void OnProvidersExecuting( ApplicationModelProviderContext contex
8181
{
8282
var controller = controllers[i];
8383

84-
controller.ControllerName = NamingConvention.NormalizeName( controller.ControllerName );
84+
if ( controller.RouteValues.TryGetValue( "controller", out var name ) )
85+
{
86+
controller.ControllerName = name!;
87+
}
88+
else
89+
{
90+
controller.ControllerName = NamingConvention.NormalizeName( controller.ControllerName );
91+
}
8592

8693
if ( !ConventionBuilder.ApplyTo( controller ) )
8794
{

‎src/AspNetCore/WebApi/src/Asp.Versioning.Mvc/Asp.Versioning.Mvc.csproj

Copy file name to clipboardExpand all lines: src/AspNetCore/WebApi/src/Asp.Versioning.Mvc/Asp.Versioning.Mvc.csproj
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<VersionPrefix>7.1.0</VersionPrefix>
4+
<VersionPrefix>7.1.1</VersionPrefix>
55
<AssemblyVersion>7.1.0.0</AssemblyVersion>
66
<TargetFramework>net7.0</TargetFramework>
77
<RootNamespace>Asp.Versioning</RootNamespace>
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-

1+
If Controller Attribute is set, use it for the controller name ([#1033](https://github.com/dotnet/aspnet-api-versioning/issues/1033))

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.