-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Trim Async suffix on action names #7420
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
Conversation
cc @BrennanConroy @halter73 We should do this in SignalR as well |
...Microsoft.AspNetCore.Mvc.Core/ApplicationModels/SuppressAsyncSuffixInActionNameConvention.cs
Outdated
Show resolved
Hide resolved
...Microsoft.AspNetCore.Mvc.Core/ApplicationModels/SuppressAsyncSuffixInActionNameConvention.cs
Outdated
Show resolved
Hide resolved
/// Gets or sets a value that determines if MVC will ignore the suffix "Async" applied to | ||
/// controller action names. | ||
/// <para> | ||
/// When <see langword="true"/>, MVC will strip action names of the Async suffix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/the/an/ (action names don't always end with Async 😺)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix this
.../Microsoft.AspNetCore.Mvc.Core.Test/ApplicationModels/DefaultApplicationModelProviderTest.cs
Outdated
Show resolved
Hide resolved
....AspNetCore.Mvc.Core.Test/ApplicationModels/SuppressAsyncSuffixInActionNameConventionTest.cs
Outdated
Show resolved
Hide resolved
} | ||
|
||
[Fact] | ||
public async Task ActionCannotBeRoutedWithAsyncSuffix() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest ActionIsNotRoutedWithAsyncSuffix()
because it can be routed if the convention is disabled.
What do you do if you want the action name to use async? |
Or, turn the new option off. |
Hadn't thought about |
🆙 📅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still looks good to me
/// Gets or sets a value that determines if MVC will ignore the suffix "Async" applied to | ||
/// controller action names. | ||
/// <para> | ||
/// When <see langword="true"/>, MVC will strip action names of the Async suffix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix this
return Ok(); | ||
} | ||
|
||
public IActionResult ActionReturningViewAsync() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor but it looks strange to have a sync method named with an Async suffix.
d35cd6a
to
607b8a7
Compare
Fixes #4849