>I don't know anything about your QueryRequest or QueryHelper classes, but if QueryRequest doesn't let you change the query, you may have problems with that class. I also don't understand why QueryHelper needs both an IQueryable and QueryRequest.
>
>As for a generic class with a subset of data, that probably isn't going to work. The closest you are going to get with C# is either anonymous types, dynamic types, or datatables, and I don't think you are going to be able to pass in the necessary code to create those in as a list of strings or a dictionary. You could maybe pass in a Func that creates the objects, but you would be adding a lot of complexity to your code for probably very little gain.
I'll look closer into the QueryRequest class. May be you're right and I will be able to add that select into that class as you suggested.
Thanks again.
I looked into the QueryRequest class and it only has Filter and some extra properties, e.g.
public class QueryRequest
{
public string OrderBy { get; set; }
public string Dir { get; set; }
public int Page { get; set; }
public int PageSize { get; set; }
public Filter FilterInfo { get; set; }
public QueryRequest()
{
Page = 1;
PageSize = 15;
FilterInfo = new Filter();
}
}
So I would not be able to add select to that class instance.
If it's not broken, fix it until it is.
My Blog