How to make the class as an IEnumerable in C#?

前端 未结 5 1535
长情又很酷
长情又很酷 2020-12-31 01:07

So I\'ve got a class and a generic List inside of it, but it is private.

class Contacts
{
    List contacts;
    ...
}

I wan

5条回答
  •  长情又很酷
    2020-12-31 01:47

    How about just extending List

    If you don't want to extend any other class its a very simple, fast option:

    class Contacts :List
    {   
    }
    

提交回复
热议问题