Hi
How to override Add Method of List<> ?
public class ccCity : List
{
public cCity this[string name]
{
get
{
foreach (cCity item in this)
{
if (item.cvrName==name)
{
return item;
}
}
return null;
}
}
public new void Add(cBaseCVR cvr)
{
this.Add(cvr);
}
}
thanks
Jignesh TrivediPosted Jun 24, 2015, 12:00 AM
Hi,
Add method is define in ICollection interface and for the list it is not virtual so we cannot override...
instead of you can implement Icollection interface in your class.
hope this will help you.