I have a function as below.
private IList<ContactList> getEmptyRow()
{
var _ContactList = new List<ContactList>();
_ContactList.Add(new ContactList()
{
Email = string.Empty,
Name = string.Empty
});
return _ContactList;
}
I would like to change my class ContactList to
private IList<T> getEmptyRow() { ..... T.Add(new T()....
Is this possible ? and how ?
Every suggestion will be appreciated.
Something like this perhaps?
You need an interface or base class so you can set the public properties
EmailandNameand you need thenew()constraint so you can use the default constructor.