Thanks cathal, this works great, and is a much-needed update! I took
what you did and was able to reduce the code quite a bit, so I thought
I'd share. This should be functionally equivalant:
[AttributeUsage(AttributeTargets.Method, AllowMultiple =
false, Inherited = true)]
public sealed class RollBackAttribute : DecoratorPatternAttribute
{
public override IRunInvoker GetInvoker(IRunInvoker invoker)
{
return new RollBackRunInvoker(invoker);
}
private class RollBackRunInvoker : DecoratorRunInvoker
{
public RollBackRunInvoker(IRunInvoker invoker) : base(invoker)
{}
public override object Execute(object o, IList args)
{
using (TransactionScope scope = new
TransactionScope(TransactionScopeOption.RequiresNew))
{
return base.Invoker.Execute(o, args);
}
}
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MbUnit.User" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/MbUnitUser?hl=en
-~----------~----~----~----~------~----~------~--~---