If I have an abstract class with an async method I can override this method in an implementing class. However, what would be the most optimal way of overriding this method? Should the base method be awaited in the implementing class, or should it just return the original Task
?
public abstract class Animal {
public async Task<int> DoSomething() {
return await DoSomethingElse();
}
}
public class Giraffe : Animal {
// Awaiting the base method?
public new async Task<int> DoSomething() {
return await base.DoSomething();
}
// Or returning the base method's Task?
public new Task<int> DoSomething() {
return base.DoSomething();
}
}