public static void AsyncUsing(Action action, bool useSymbiosis) { Task.Run(() => { try { Initialize(); if (useSymbiosis) { Symbiosis.Open(); } action(); } catch (Exception ex) { LogWrapper.Default.Fatal(ex); } finally { if (useSymbiosis) { Symbiosis.Close(); } Dispose(); } }); }
/// <summary> /// /// </summary> public static void Using(Action action, bool useSymbiosis) { try { Initialize(); if (useSymbiosis) { Symbiosis.Open(); } action(); } catch (Exception ex) { throw ex; } finally { if (useSymbiosis) { Symbiosis.Close(); } Dispose(); } }