Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dynamic where condition
Message
 
 
À
30/06/2015 14:37:15
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01621606
Message ID:
01621612
Vues:
38
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform