From 09c494e7ebac58e119fd3eeaa1966b6955e7df4f Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Mon, 21 Jan 2019 10:09:47 +0300 Subject: [PATCH] Domain services should be used inside UOW --- .../ProductManagement/ProductManagementTestDataBuilder.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/ProductManagement/ProductManagementTestDataBuilder.cs b/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/ProductManagement/ProductManagementTestDataBuilder.cs index 68c858a271..8dea7b1ad9 100644 --- a/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/ProductManagement/ProductManagementTestDataBuilder.cs +++ b/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/ProductManagement/ProductManagementTestDataBuilder.cs @@ -2,6 +2,7 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.Guids; using Volo.Abp.Threading; +using Volo.Abp.Uow; namespace ProductManagement { @@ -23,7 +24,8 @@ namespace ProductManagement AsyncHelper.RunSync(BuildAsync); } - public async Task BuildAsync() + [UnitOfWork] + public virtual async Task BuildAsync() { await _productManager.CreateAsync(_testData.ProductCode1, _testData.ProductName1, _testData.ProductPrice1, _testData.ProductStockCount1); await _productManager.CreateAsync(_testData.ProductCode2, _testData.ProductName2, _testData.ProductPrice2, _testData.ProductStockCount2);