F# has a similar using
block to C#.
using (new Thing()) (fun x -> x.DoStuff ... )
But there is also a use
binding in F#, which works just like let
except it calls Dispose
when the object goes out of scope. It's not too hard to make a new type that wraps TransactionScope
and calls Complete
when it's disposed if it hasn't been rolled back by code...
It would also be possible to make a workflow builder take care of transactions.
However, you might be better off using a database layer such as Entity Framework which handles your transactional needs.