When I pass (just for display values) to the viewbag an array or a list.
Does it change something ( for the speed or memory ) when browsing the elements in a foreach with the razor engine?
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.
The performance impact of choosing an array[] over an List is negligible in most cases.
Sure, array[] are less abstract and used “as is” in the CLR, but the hassle of loosing all the capabilities of List objects is usually not worth the minimal performance boost.
You can read more here : https://stackoverflow.com/a/5777746/971693