I have the following Model pattern:
public abstract class PARENTCLASS {...}
public class CHILD_A_CLASS : PARENTCLASS{...}
public static class EXTENSION{
public static METHOD(this PARENTCLASS parent){...}
public static METHOD(this CHILD_A_CLASS child) {...}
}
Something like above, of course there will be more child (and grandchild) classes but I just put one of them. The problem is, when I called the extension method like the following:
PARENTCLASS cc = new CHILD_A_CLASS();
cc.METHOD();
It will execute the PARENT Extension Method instead of my-expected CHILD extension method. Anyone have idea on how to implement this? (I'm not considering putting the METHOD itself into the class and let it do inheritance because I want to keep the model class clean and away from other logic).