TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
LB Elbino
NA
4
0
Create a generic list List
where T is only known at runtime
Nov 9 2007 10:00 AM
Please help,
I have a method that returns an Object. This returned object could be a generic list of 4 or more classes in my code.
i.e the object could be List<class1>, List<class2>, List<class3> etc.
At runtime when I recieve this object, I want to be able to cast it to a list of the appropriate type.
PS. The methods return value is object. The writers of this class that I'm calling basically create a generic list and fill it up, then for reason i cant explain, they cast the list to an object and return is.
The return line is exactly ==> return (object)thegeneicList
How do I go about creating a generic list List<T> where T is only known at runtime
Reply
Answers (
2
)
Connecting to aremote database
Frame index information