I'm unable to declare
interface IMyInterface
{
async Task<myObject> MyMethod(Object myObj);
}
The compiler tells me:
Is this something that should be implemented, or does the nature of async & await prohibit this from ever occurring?
Whether a method is implemented using async/await or not is an implementation detail. How the method should behave is a contract detail, which should be specified in the normal way.
Note that if you make the method return a
Task
or aTask<T>
, it's more obvious that it's meant to be asynchronous, and will probably be hard to implement without being asynchronous.