I have IEnumerable<object> Value. Can I get model type and then declare same type List?
for example i got IEnumerable then want to declare List<cars> lst = new List<cars>
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No. Template types are determined at compile-time. However, you could try declaring it as
You wouldn’t get true type safety but you could access the properties in your form without using reflection: