Can anyone help me on how to convert the following c# code to use linq to sql? By using linq to sql, would that execute faster or would it still be the same as below?
foreach (var a in all)
{
for (int i = 0; i < a.Items.Length; i++)
{
if (a.Items[i].Item.TruckItemID.Equals(CarItem.CarItemID))
{
allItems = a.Items[i];
}
}
}
Looks like you want something like:
Keep in mind, though, that the execution isn’t going to speed up. LINQ will expand your query into nearly the same code.