radzenhq / radzen-blazor

Radzen Blazor is a set of 90+ free native Blazor UI components packed with DataGrid, Scheduler, Charts and robust theming including Material design and FluentUI.
https://www.radzen.com
MIT License
3.52k stars 785 forks source link

Blazor 5.0 server - warning CS1998 #49

Closed Foizman closed 3 years ago

Foizman commented 3 years ago

Hi,

I tried your solution, created a simple test project directly without adaptation and imported a test DB from SQL server. There are many warnings when I press RUN.

Then I analyzed the code in Visual Studio and there I also get a lot of "CS1998" warnings:

6f5b59c2738eb4f941d81099502681804b4f3e75

Visual Studio says there is an asynchronous task method, but no waiting time, as can be clearly seen in the generated code:

421e3d2f41913478bc54b9cba63950269814aeec

Any idea to avoid that?

Cheers, FM

akorchev commented 3 years ago

This repository is about the Radzen.Blazor component library. You seem to be using the Radzen IDE which is a different product.

To answer your question - yes, Radzen generates async methods by default as certain Radzen actions lead to async code. Since it is now known initially all methods are async. All Radzen applications address that warning by suppressing it in the csproj file.

Next time please follow the issue template.

Foizman commented 3 years ago

Thank you!