I’ve worked on a baseline with code in this this form:
Var result = await Task.FromResult(_someObject.SomeNonAsyncMethod(someParameterObject));
From what I understand about Task.FromResult, this is simply packaging an object into a result form, not packaging a method into a task for asynchronous execution. Therefor the operations are adding extra overhead without any benefit.
Is this understanding correct?
Is this use of await doing anything useful in terms of performance?
Should await Task.FromResult ever be used in this way? (considering this line used alone - not implementing an interface or in a test, ect.)
Thanks in advance for any insight!