You need to assign the result of query.Select(...) to query variable to actually change the query, which in your case you are not doing so your Select don't have any effect. But once you do it you will have a projection of result and the rest of the fields won't be available neither to add more fields to the projection nor to add where conditions.
So that approach will never work for the Select statement. You need to build a dynamic Expression Tree to select desired properties instead. Fortunately, somebody has already worked on this here, please look at @dotlatice answer which is what you need imo.
So, you code would be:
Apply where condition as you are doing now
Build an expression tree that produces an anonymous type containing your desired columns
Asked in February 2016Viewed 1,891 timesVoted 11Answered 1 times