When to use var or IEnumerable to store query result in LINQ?
Answer Posted / Mohd Kasim Khan
Use var when you don't need the specific type of the collection. The compiler will infer the correct type based on the query results. Use IEnumerable when you want to explicitly specify that the collection is an IEnumerable and can be iterated.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
No New Questions to Answer in this Category !! You can
Post New Questions
Answer Questions in Different Category