Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dynamic where condition
Message
 
 
To
30/06/2015 14:37:15
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01621606
Message ID:
01621612
Views:
39
>>I am just not sure yet how to build the LINQ command where I would use 'dynamic' condition. I haven't yet written the code, I am just thinking about it. I guess I'll try it now to see where I'd run into the problem.
>
>The LINK command can be adjusted to include your variable. So, in your code, you can have an IF ELSE with those two queries that you need or have one query with a string variable in the middle to insert the dynamic portion.
>
>
>                oClient = (From j In oClient.Jobs Where j.ClientId = cClientID Order By j.UpdatedOn Ascending).ToList()
>
I see, you suggest to simply write N commands for each type. Since my final result is an integer count, I guess I can declare it and write as many commands as I have types - it may be a simple solution here.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform