How to implement a function return List<T>
I am very interested in C# Generic class specially in List<T>.
Are there any way for me to have a function to return a List<T>
as code segment below. If you know how to do it, please share your idea.
Regards,
Jdang
/***********************************************/
public List<T> ( some parameters..., Type type) {
switch( type) {
case Invoice:
List<Invoice> list = new List<Invoice>;
....
....
....
return list;
case Order:
List<Order> list = new List<Order>;
....
....
....
return list;
}
}
|