public static async Task CreateAsync(IUnitOfWorkFactory unitOfWorkFactory, IRepositoryFactory repositoryFactory, string productName, string customerName) { await unitOfWorkFactory.ExecuteTransactionAsync(async (uow) => { var quoteRepository = repositoryFactory.Create <IQuoteRepository>(uow); var quoteId = await quoteRepository.CreateAsync(new Quote(productName)).ConfigureAwait(false); await quoteRepository.CreateAsync(new QuoteCustomer(quoteId, customerName)).ConfigureAwait(false); }, async() => { Console.WriteLine("Something went wrong!!!"); }); }