Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev/xavier/fix controller name attr #1039

Merged
merged 19 commits into from
Nov 22, 2023
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
6 changes: 5 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,8 @@ dotnet_naming_style.test_methods.word_separator = _

dotnet_naming_rule.test_methods.style = test_methods
dotnet_naming_rule.test_methods.symbols = test_methods
dotnet_naming_rule.test_methods.severity = error
dotnet_naming_rule.test_methods.severity = error

# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1825
[*.{cs,vb}]
dotnet_diagnostic.CA1825.severity = none
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,14 @@
for ( var i = 0; i < controllers.Count; i++ )
{
var controller = controllers[i];

controller.ControllerName = NamingConvention.NormalizeName( controller.ControllerName );
if ( controller.RouteValues.TryGetValue( "controller", out var name ) )
{
controller.ControllerName = name!;
}
else
{
controller.ControllerName = NamingConvention.NormalizeName( controller.ControllerName );
}
Dismissed Show dismissed Hide dismissed

if ( !ConventionBuilder.ApplyTo( controller ) )
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>6.4.0</VersionPrefix>
<VersionPrefix>6.4.1</VersionPrefix>
<AssemblyVersion>6.4.0.0</AssemblyVersion>
<TargetFrameworks>net6.0;netcoreapp3.1</TargetFrameworks>
<RootNamespace>Asp.Versioning</RootNamespace>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@

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