Select only the columns I want?

Feb 20, 2014 at 1:47 AM
In your example you have this:

var customers =
            .Include(i => i.CustomerDemographics)
            .OrderBy(q => q
                .OrderBy(c => c.ContactName)
                .ThenBy(c => c.CompanyName))
            .Filter(q => q.ContactName != null)
            .GetPage(pageNumber, pageSize, out totalCustomerCount);
Is there a way to select the columns you want returned instead of all of them? I need a .Select for the columns.

var customers =
            .Filter(q => q.ContactName != null)
                  s =>
                               s.FirstName + " " + s.LastName
I am assuming the GetPage handles the .Take(10)?

I need something like this because I am using an auto complete controller for jQuery auto complete and I only need to return the ID and the name concated together.
Apr 1, 2014 at 6:38 AM
There is a Select overload that will let you do projections released.
Marked as answer by lelong37 on 3/31/2014 at 10:38 PM