public async Task GivenOrderItemsExist(Table table) { foreach (var orderItemTableItem in table.CreateSet <OrderItemTable>()) { var orderItemEntity = OrderItemEntityBuilder .Create() .WithOrderId(orderItemTableItem.OrderId) .WithCatalogueItemId(orderItemTableItem.CatalogueItemId) .WithProvisioningType(orderItemTableItem.ProvisioningType) .WithPricingUnitName(orderItemTableItem.CataloguePriceUnitName) .WithTimeUnit(orderItemTableItem.PriceTimeUnit) .WithEstimationPeriod(orderItemTableItem.EstimationPeriod) .WithCurrencyCode(orderItemTableItem.CurrencyCode) .WithPriceId(orderItemTableItem.PriceId) .WithPrice(orderItemTableItem.Price) .WithCreated(orderItemTableItem.Created ?? DateTime.UtcNow) .Build(); await orderItemEntity.InsertAsync(settings.ConnectionString); orderContext.AddOrderItem(orderItemEntity); } }