Apparently extension methods don't work in subclasses, or is it just me?
private class Parent
{
}
private class Child
{
}
public static class Extensions
{
public static void Method(this Parent parent)
{
}
}
var p = new Parent();
p.Method();
var c = new Child();
c.Method();
UPDATE
There is a typo in this question (which I leave, so the rest makes sense) - I forgot to do Childinherit from Parent.
Be that as it may, my real problem was that I did not have the appropriate operator using.
(Unfortunately, I cannot delete, because there are too many answers when answering.)
source
share