Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

c# blazor avoid using 'async' lambda when delegate type returns 'void'

$
0
0

I get the following warning in JetBrains Rider and I can't find a way to workaround it.It's a blazor WASM project with .net 6.

Avoid using 'async' lambda when delegate type returns 'void'

Sample code Razor:

<Validation Validator="async e => await ValidateFieldAsync(e)">

Sample code c#:

protected async Task ValidateFieldAsync(ValidatorEventArgs args){    // Some code with awaits etc.}

Jetbrains describes this warning here:

https://www.jetbrains.com/help/resharper/AsyncVoidLambda.html

But what is the best practice here to fix this?

Thanks for any hints!


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>