private static Action CreateNewAction(Action call) { return(delegate { IDexterCall dexterCall = DexterContainer.Resolve <IDexterCall>(); dexterCall.StartSession(); try { call.Invoke(); dexterCall.Complete(true); } catch { dexterCall.Complete(false); throw; } }); }
private static Func <T> CreateNewFunc <T>(Func <T> call) { return(delegate { IDexterCall dexterCall = DexterContainer.Resolve <IDexterCall>(); dexterCall.StartSession(); try { T returnObject = call.Invoke(); dexterCall.Complete(true); return returnObject; } catch { dexterCall.Complete(false); throw; } }); }