In a recent interview, I was asked about What is the Difference Between IEnumerable and IQueryable in C#?I googled it, but still not clear properly what is the difference and which all cases each one fit properly.Please explain in a simple manner that What is the Difference Between IEnumerable and IQueryable.
The main difference between IEnumerable and IQueryable in C# is,
IEnumerable is suitable for querying data from in-memory collections such as Array and List.IEnumerable is beneficial for LINQ to XML and LINQ to Object queries.
IQueryable is suitable for querying data from out-of-memory collections such as databases.IQueryable is beneficial for Linq to SQL queries.
You must be logged in to reply to this topic.
© Copywright 2017 Dotnetstuffs All Rights Reserved