1
Answer

How to override Add Method of List<> ?

behzad pakniyat

behzad pakniyat

9y
506
1
Hi
 
How to override Add Method of List<> ?
 
public class ccCity : List<cCity>
{
   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 

Answers (1)