I need to create a where clause at runtime, but I need to do an OR with a where clause. Is this possible ... Let me explain ..
here is my code ... basically "filter" is a bitwise renaming, son, so the filter can be equal to more than 1 of the following. So I need to create a where clause ...
If I execute the sections separately, than I suppose, if I do Untested first and it will return 0 records, which means that I can’t execute where on testing, because there are now 0 records.
I will put the code under the alias below :-)
string myWhere = "";
if ((filter & Filters.Tested) == Filters.Tested)
{
if (myWhere != "" ) myWhere =myWhere + "||";
myWhere = myWhere " Status == "Tested";
}
if ((filter & Filters.Untested) == Filters.Untested)
{
if (myWhere != "" ) myWhere =myWhere + "||";
myWhere = myWhere " Status == "Untested";
}
if ((filter & Filters.Failed) == Filters.Failed)
{
if (myWhere != "" ) myWhere =myWhere + "||";
myWhere = myWhere " Status == "Failed";
}
// dataApplications = a List of items that include Tested,Failed and Untested.
// dataApplciation.Where ( myWhere) --- Confused here!
Is it possible.
"IFs", cobinations, .. , filter = testing Only, filter = Untested and Tested...