Workaround for lack of return type covariance when overriding virtual methods
问题 is there any way to 'hack' or 'coerce' covariant overrides in to C#? For example: public class Alpha { public virtual Alpha DoSomething() { return AlphaFactory.GetAlphaFromSomewhere(); } } public class Beta : Alpha { public override Beta DoSomething() { return BetaFactory.GetBetaFromSomewhere(); } } Unfortunately, C# doesn't support this (which seems a bit ridiculous, but that's neither here nor there). I thought I might have an answer with method hiding: new public Beta DoSomething() {