I have a relatively simple use case which is failing. Consider the following code:
[OperationBehavior(TransactionScopeRequired = true)]
public IEnumerable<StatusRecord> ReadActive(int contactID, bool isActive)
{
var result = from n in ORM.Default.Table<StatusRecord>()
where n.lng_contact_id == contactID && n.dte_effective_end == null
select n;
return result;
}
This is using a custom LINQ-SQL provider of our own evil origins. Normally this type of call works great, but when using it from a DTC Transacted WCF call, it hangs. My theory is that the serialization of the result into an array somehow occurs outside the transaction scope and therefore hangs. Furthermore, my theory is supported by the fact that changing the line
return result;
to
return result.ToArray();
makes things work. Although I am pleased to have a workaround, it seems there is a better way to get this behaving. Please advise. Thank you!