Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Action conventions for async methods

See original GitHub issue

The 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:closed
  • Created 8 years ago
  • Reactions:3
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

BrunoJuchlicommented, May 5, 2015


Methods returning Task are treated by Caliburn.Micro like coroutines. When the Task throws an Exception you’ll be informed by the Coroutine.Completed event. The ResultCompletionEventArgs.Error property will contain the Exception.

nigel-sampsoncommented, Nov 29, 2015

Resolved in #158 still considering changing the behavior of coroutines.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found