Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VS 2013 can not evaluate expression
Message
 
 
To
08/08/2014 15:59:16
General information
Forum:
ASP.NET
Category:
Troubleshooting
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01605242
Message ID:
01605355
Views:
34
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform