Ejemplo n.º 1
0
 /// <summary>
 /// Executes an <see cref="Func{ICatalogsContainer, TReturn}"/> that takes an <see cref="ICatalogsContainer"/> as parameter within
 /// a using block.
 /// </summary>
 /// <typeparam name="TReturn">The <see cref="Type"/> of the instance that is returned.</typeparam>
 /// <param name="function">The <see cref="Func{ICatalogsContainer, TReturn}"/> that is executed within the using block.</param>
 /// <returns>An instance of the specified <see cref="Type"/>.</returns>
 public static async Task <TReturn> ExecuteWithCatalogScopeAsync <TReturn>(Func <ICatalogsContainer, TReturn> function)
 {
     return(await TaskStarter.StartNew(() => ExecuteWithCatalogScope(function)));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Executes an <see cref="Action{ICatalogsContainer}"/> that takes an <see cref="ICatalogsContainer"/> as parameter within
 /// a using block.
 /// </summary>
 /// <param name="action">The <see cref="Action{ICatalogsContainer}"/> that is executed within the using block.</param>
 public static async Task ExecuteWithCatalogScopeAsync(Action <ICatalogsContainer> action)
 {
     await TaskStarter.StartNew(() => ExecuteWithCatalogScope(action));
 }