IEnumerable<T> hoạt động trên in-memory collections, tải toàn bộ dữ liệu rồi mới filter (LINQ to Objects). IQueryable<T> nhắm vào nguồn dữ liệu remote (database), xây dựng expression tree và thực thi filter tại nguồn để tiết kiệm băng thông.
Dùng IQueryable cho dataset lớn; dùng IEnumerable cho collections đã có sẵn trong bộ nhớ.
IEnumerable<T> operates on in-memory collections, filtering after loading all data (LINQ to Objects). IQueryable<T> targets remote sources like databases, building expression trees and executing filtering at the source for efficiency.
Use IQueryable for large datasets; use IEnumerable for in-memory collections.