Hi @sravankumar-3852 ,
Check the relevant document, you can know:
If the method that the async keyword modifies doesn't contain an await expression or statement, the method executes synchronously. A compiler warning alerts you to any async methods that don't contain await statements, because that situation might indicate an error.
So the method you mentioned (new code) will have the same effect as the old method and get a warning. Therefore I do not recommend that you define the method this way, it would be better to follow the documentation.
For more about asynchronous programming, you can refer to this document: Asynchronous programming with async and await
Best regards,
Xudong Peng
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.