Почему метод AsyncEventHandler может возвращать void или Task? ⇐ C#
-
Anonymous
Почему метод AsyncEventHandler может возвращать void или Task?
Blazor has a callback AsyncEventHandler struct that is used for declaring events in a component. Here’s a useful discussion about how to get called by the event.
I’ve found that the method assigned to an AsyncEventHandler can return void or Task. How can it return void when it’s declared to return Task. Does the system view a return of void being a Task that has completed?
And I’m talking here of a method that returns void, not “async void”. So a truly synchronous method.
Источник: https://stackoverflow.com/questions/780 ... id-or-task
Blazor has a callback AsyncEventHandler struct that is used for declaring events in a component. Here’s a useful discussion about how to get called by the event.
I’ve found that the method assigned to an AsyncEventHandler can return void or Task. How can it return void when it’s declared to return Task. Does the system view a return of void being a Task that has completed?
And I’m talking here of a method that returns void, not “async void”. So a truly synchronous method.
Источник: https://stackoverflow.com/questions/780 ... id-or-task
Мобильная версия