Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public static class Db4oExtensions
{
public static void InTransaction(this IObjectContainer container,
Action<IObjectContainer> txClosure )
{
InTransaction(container, c =>
{
txClosure(c);
return true;
});
}
public static T InTransaction<T>(this IObjectContainer container,
Func<IObjectContainer,T> txClosure)
{
try
{
return txClosure(container);
}
finally
{
container.Commit();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.