public static void Using(this IBusyState state, Action execute) { using (state.Begin()) { execute(); } }
public static async Task UsingAsync(this IBusyState state, Func <Task> execute) { using (state.Begin()) { await execute().ConfigureAwait(true); } }
public static async Task <TResult> UsingAsync <TResult>(this IBusyState state, Func <Task <TResult> > execute) { using (state.Begin()) { return(await execute().ConfigureAwait(true)); } }
public static TResult Using <TResult>(this IBusyState state, Func <TResult> execute) { using (state.Begin()) { return(execute()); } }