Is it OK to have virtual async method on base class?

后端 未结 3 1003
北荒
北荒 2021-02-04 23:29

I am working with some code, where I have 2 classes with very similar logic and code. I have protected async void LoadDataAsync() method on both classes.
Curren

3条回答
  •  失恋的感觉
    2021-02-05 00:17

    Yes, it's fine, but you should use async Task instead of async void. I have an MSDN article that explains why.

提交回复
热议问题