I just want to know if there is any known issue, or if I'm doing something wrong. Everytime I do something like the example below, I get an error "the server failed to resume the transaction".
I had already asked another question about this error, but now I've figured out it only appears in the foreach
loops
//Listing orders
IQueryable<Order> ordersList = ListOrders();
foreach (Order order in ordersList)
{
if (order.Client_Id != null) //get the exception here.
{
//some code
}
}
Update: the code for ListOrders()
public IQueryable<Order> ListOrders()
{
try
{
return from o in db.Orders
where o.Id == this.Id
select o;
}
catch (Exception ex)
{
throw new Exception(ex.Message, ex);
}
}