Why sometimes List collections doesn’t support OrderBy or ToList() or other methods and Intellisence wouldn’t even show them?
Why sometimes List collections doesn’t support OrderBy or ToList() or other methods and Intellisence
Share
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.
Any type that implements the
IEnumerable<T>interface can be used with the LINQ extension methods:OrderBy,ToListetc.List<T>implementsIEnumerable<T>, and so does almost every other generic collection that you’re likely to encounter.However, because LINQ is primarily implemented using extension methods, you’ll need to include a
using System.Linqdirective at the top of your code file. If you don’t haveusing System.Linqthen the LINQ extensions aren’t going to appear in intellisense etc.