Given the following classes:
ClassA
{
public ClassA DoSomethingAndReturnNewObject()
{}
}
ClassB : ClassA
{}
ClassC : ClassA
{}
Maybe generics will be your saviour. Take a look at this link: C# Generics Part 3/4: Casting, Inheritance, and Generic Methods
bstract class B {
public abstract T Fct(T t);
}
class D1 : B{
public override string Fct( string t ) { return "hello"; }
}
class D2 : B{
public override T Fct(T t) { return default (T); }
}