Contents tagged with LINQ

  • Dynamic LINQ Part 2 (Evolution)

    A while ago, Scott Gu blogged about a Dynamic LINQ library that was part of the C# samples in VS2008. This library let developers put together late bound LINQ queries using a special syntax. This really comes in handy when you want to build a LINQ query based on dynamic input. Consider the following example:

  • Dynamic Sorting with Linq

    When trying to implement a Business Logic Layer (i will refer to this as BLL) with linq one thing that is an annoyance is sorting. Lets say you had a BLL that was being used by ObjectDataSource and had a select method that does sorting and paging, then you'd probably be tempted to write something like this:

    private IQueryable<Product> SortBy(IQueryable<Product> source, string sortBy) {