public MainPage() { var set2 = new[] { 1, 2, 3 }.AsQueryable(); set2.AsExpandable(); this.InitializeComponent(); }
public static IEnumerable<Book> GetResults(Expression<Func<Book, bool>> criteria) { IQueryable<Book> db = new[] { new Book { Title = "War and Peace", Author = "Leo Tolstoy"}, new Book { Title = "Hunger", Author = "Knut Hamsun" }, new Book { Title = "Embers", Author = "Sandor Marai" } }.AsQueryable(); var query = from book in db.AsExpandable() where criteria.Invoke(book) select book; return query; }