Hi, I have a sample class:
class SampleClass
{
public virtual string SomeProperty{get; set;}
public virtual void SomeMethod() {
// code
}
}
I can Inherit from it and override SomeProperty and SomeMethod like this:
class ChildClass:SampleClass
{
public override string SomeProperty{get; set;}
public override void SomeMethod() {
// code
}
}
Is there any way I can override from a object, not from a class? Like
SampleClass sampleObject = new sampleObject();
And have sampleObject.SomeMethod() be unique? Thanks.