public void Execute(C context) { var currentPrincipal = Thread.CurrentPrincipal; try { Thread.CurrentPrincipal = PrincipalProvider.Provide(context); UnderlyingOperation.Execute(context); } finally { Thread.CurrentPrincipal = currentPrincipal; } }
public void Execute(C context) { IDictionary contextDict = context as IDictionary; if (contextDict == null && context != null) { ITypeConverter conv = ConvertManager.FindConverter(context.GetType(), typeof(IDictionary)); if (conv != null) { contextDict = conv.Convert(context, typeof(IDictionary)) as IDictionary; } } if (contextDict == null) { contextDict = new Hashtable(); contextDict[DefaultContextKey] = context; } UnderlyingOperation.Execute(contextDict); }
public void Execute(C context) { if (Begin != null) { Begin.Execute(context); } try { UnderlyingOperation.Execute(context); if (Commit != null) { Commit.Execute(context); } } catch (Exception ex) { if (Abort != null) { Abort.Execute(context); } throw new Exception(ex.Message, ex); } }