167k views
4 votes
"What is the return type of a LINQ query?

a Array of string type
b.Collection of string type
c.Collection of generic type
d.Collection of object type
e.Boolean type"

User MatlabDoug
by
8.4k points

1 Answer

3 votes

Final answer:

The return type of a LINQ query is a collection of generic type, specifically an IEnumerable or IQueryable of T, where T is the type of the data.

Step-by-step explanation:

The return type of a LINQ (Language Integrated Query) query is typically a collection of generic type. When you execute a LINQ query, it commonly returns an IEnumerable<T> or a IQueryable<T>, where T is the type of the objects being queried. This allows the LINQ query to be flexible and work with any type of data. For example, if you're querying a list of strings, the result will be an IEnumerable<string>. If you're querying a list of a custom class such as Book, it will return an IEnumerable<Book>. LINQ utilizes deferred execution, meaning the query is not executed until you iterate over the collection.

User Techytushar
by
8.0k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.