What can I do when I have an interface that returns a task (void) but one of the implementations has no async action?
My interface IDatabaseService has two implementations: FirestoreDatabaseService and CacheDatabaseService. It makes sense for FirestoreDatabaseService to use the Method async Task AddResult(ResultDto result) as result of a method but the CacheDatabaseService has only a list and needs no await, it is basically a void method.
I get a warning "Warning CS1998 This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)'" when I implement the method in CacheDatabaseService async. If I remove the async I have to return a task but Task.FromResult does not work for void Tasks.