Scaleable Fluent Interface with Inheritance
问题 I am trying to write a Fluent Interface API that can scale well. What structure would allow for strong types, inheritance, and state-full(as in the class type)? For instance class A { public A PerformFoo() { //do stuff return this; } } class B : A { } I would like class B when calling PerformFoo to return B not A, ideally I would prefer to stay away from public class B : A { public new B PerformFoo() { return (B)base.PerformFoo(); } } As to not have to override or new Every method in child