If i do the following:
Using scope = New TransactionScope()
entries.Content.ReadAs(Of IList(Of WebMaint)).AsParallel.ForAll(Sub(entry)
_repos.Update(entry)
End Sub)
scope.Complete()
End Using
TransactionScope doesn't work. If i put a breakpoint on the scope.complete no transaction is active and the updates are already complete.
If i change it to:
Using scope = New TransactionScope()
entries.Content.ReadAs(Of IList(Of WebMaint)).ToList().ForEach(Sub(entry)
_repos.Update(entry)
End Sub)
scope.Complete()
End Using
Everything works as expected. Anyone know why the parallel version doesn't work correctly?