I have used and learned only virtual methods of the base class without any knowledge of virtual properties used as
class A
{
public virtual ICollection<
public virtual ICollection Prop { get; set; }
Translates almost directly to:
private ICollection m_Prop;
public virtual ICollection get_Prop()
{
return m_Prop;
}
public virtual void set_Prop(ICollection value)
{
m_Prop = value;
}
Thus, the virtual keyword allows you to override the property in sub-classes just as you would the above get/set methods:
public override ICollection Prop
{
get { return null; }
set { }
}