Jesper Christensen
asked on
foreach(var line in order.orderLines)
How can I optimize this foreach:
foreach(var line in order.orderLines)
{
if (line.productId != "")
{
//run
}
}
Is it possible to include the if line.productid != "" in foreach, so it looks something like.
foreach(var line in order.orderLines and line.productid != "")
foreach(var line in order.orderLines)
{
if (line.productId != "")
{
//run
}
}
Is it possible to include the if line.productid != "" in foreach, so it looks something like.
foreach(var line in order.orderLines and line.productid != "")
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Anytime :)
ASKER