Action conventions for async methods
See original GitHub issueThe current conventions are like x:Name="Delete"
==> Binds to methods Delete()
and guard property CanDelete
.
The guideline for methods with async
modifiers is to add an Async
suffix to them. For example:
public async Task DeleteAsync()
Now there’s a question:
should the convention pick up x:Name="Delete"
=> DeleteAsync()
or should we rename to x:Name="DeleteAsync"
?
Also, the convention should accept guard methods which don’t have an Async
suffix. For example:
public async Task DeleteAsync();
public bool CanDelete { get; }
per guideline the property should not have an Async suffix because it’s not async
.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:3
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Task asynchronous programming model
Naming convention By convention, methods that return commonly awaitable types (for example, Task , Task<T> , ValueTask , ValueTask<T> ) should ...
Read more >c# - Does the use of the "Async" suffix in a method name ...
You could say that the Async suffix convention is to communicate to the API user that the method is awaitable. For a method...
Read more >Why do people add Async to method names in new code?
I do append "Async" to the name of all my async methods for two reasons: ... The Async suffix isn't just there for...
Read more >Long Story Short: Async/Await Best Practices in .NET
This is the convention used in .NET to more-easily differentiate synchronous and asynchronous methods (except event handlers or web ...
Read more >[Discussion] Async suffix for controller action names will be ...
As part of addressing #4849, ASP.NET Core MVC will trim the suffix Async from action names by default. This affects routing and link...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@altso
Methods returning
Task
are treated by Caliburn.Micro like coroutines. When the Task throws anException
you’ll be informed by theCoroutine.Completed
event. TheResultCompletionEventArgs.Error
property will contain theException
.Resolved in #158 still considering changing the behavior of coroutines.