From d7023c5867697a65dd2b0be0570430df0414c26a Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Fri, 18 Jan 2019 15:12:14 +0300 Subject: [PATCH] Added product management module --- samples/MicroserviceDemo/MicroserviceDemo.sln | 105 ++++++++++++++++++ .../ProductService.Host.csproj | 37 ++++++ .../product/ProductService.Host/Program.cs | 24 ++++ .../Properties/launchSettings.json | 27 +++++ .../product/ProductService.Host/Startup.cs | 34 ++++++ .../appsettings.Development.json | 9 ++ .../ProductService.Host/appsettings.json | 11 ++ .../Localization/ApplicationContracts/en.json | 6 + .../ApplicationContracts/pt-BR.json | 6 + .../ApplicationContracts/zh-Hans.json | 6 + ...uctManagementApplicationContractsModule.cs | 37 ++++++ ...tManagementPermissionDefinitionProvider.cs | 19 ++++ .../ProductManagementPermissions.cs | 15 +++ ...uctManagement.Application.Contracts.csproj | 21 ++++ ...tManagementApplicationAutoMapperProfile.cs | 12 ++ .../ProductManagementApplicationModule.cs | 28 +++++ ...ductManagementSettingDefinitionProvider.cs | 14 +++ .../ProductManagementSettings.cs | 11 ++ .../ProductManagement.Application.csproj | 14 +++ .../ProductManagement.Domain.Shared.csproj | 12 ++ .../Localization/ProductManagementResource.cs | 10 ++ .../ProductManagementDomainErrorCodes.cs | 7 ++ .../ProductManagementDomainSharedModule.cs | 21 ++++ .../Localization/Domain/en.json | 6 + .../Localization/Domain/pt-BR.json | 6 + .../Localization/Domain/zh-Hans.json | 6 + .../ProductManagementConsts.cs | 9 ++ .../ProductManagementDomainModule.cs | 33 ++++++ .../ProductManagement.Domain.csproj | 21 ++++ .../IProductManagementDbContext.cs | 13 +++ .../ProductManagementDbContext.cs | 35 ++++++ ...agementDbContextModelCreatingExtensions.cs | 38 +++++++ ...ductManagementEntityFrameworkCoreModule.cs | 23 ++++ ...agementModelBuilderConfigurationOptions.cs | 18 +++ ...oductManagement.EntityFrameworkCore.csproj | 13 +++ .../ProductManagementHttpApiClientModule.cs | 22 ++++ .../ProductManagement.HttpApi.Client.csproj | 13 +++ .../ProductManagementHttpApiModule.cs | 13 +++ .../ProductManagement.HttpApi.csproj | 13 +++ .../Resources/ProductManagement/en.json | 6 + .../Resources/ProductManagement/pt-BR.json | 6 + .../Resources/ProductManagement/zh-Hans.json | 6 + .../ProductManagement/_ViewImports.cshtml | 4 + .../ProductManagement.Web.csproj | 35 ++++++ .../ProductManagementMenuContributor.cs | 23 ++++ .../ProductManagementWebAutoMapperProfile.cs | 12 ++ .../ProductManagementWebModule.cs | 62 +++++++++++ .../Properties/launchSettings.json | 27 +++++ .../ProductManagementApplicationTestModule.cs | 13 +++ ...ProductManagement.Application.Tests.csproj | 17 +++ .../ProductManagementDomainTestBase.cs | 7 ++ .../ProductManagementDomainTestModule.cs | 13 +++ .../ProductManagement.Domain.Tests.csproj | 16 +++ .../MyEntityRepository_Tests.cs | 7 ++ ...ManagementEntityFrameworkCoreTestModule.cs | 42 +++++++ ...anagement.EntityFrameworkCore.Tests.csproj | 20 ++++ .../MyEntityRepository_Tests.cs | 16 +++ .../ProductManagementTestBase.cs | 14 +++ .../ProductManagementTestBaseModule.cs | 37 ++++++ .../ProductManagementTestData.cs | 8 ++ .../ProductManagementTestDataBuilder.cs | 24 ++++ .../ProductManagement.TestBase.csproj | 24 ++++ 62 files changed, 1207 insertions(+) create mode 100644 samples/MicroserviceDemo/microservices/product/ProductService.Host/ProductService.Host.csproj create mode 100644 samples/MicroserviceDemo/microservices/product/ProductService.Host/Program.cs create mode 100644 samples/MicroserviceDemo/microservices/product/ProductService.Host/Properties/launchSettings.json create mode 100644 samples/MicroserviceDemo/microservices/product/ProductService.Host/Startup.cs create mode 100644 samples/MicroserviceDemo/microservices/product/ProductService.Host/appsettings.Development.json create mode 100644 samples/MicroserviceDemo/microservices/product/ProductService.Host/appsettings.json create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/MyCompanyName/ProductManagement/Localization/ApplicationContracts/en.json create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/MyCompanyName/ProductManagement/Localization/ApplicationContracts/pt-BR.json create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/MyCompanyName/ProductManagement/Localization/ApplicationContracts/zh-Hans.json create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/MyCompanyName/ProductManagement/ProductManagementApplicationContractsModule.cs create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/MyCompanyName/ProductManagement/ProductManagementPermissionDefinitionProvider.cs create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/MyCompanyName/ProductManagement/ProductManagementPermissions.cs create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/ProductManagement.Application.Contracts.csproj create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Application/MyCompanyName/ProductManagement/ProductManagementApplicationAutoMapperProfile.cs create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Application/MyCompanyName/ProductManagement/ProductManagementApplicationModule.cs create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Application/MyCompanyName/ProductManagement/ProductManagementSettingDefinitionProvider.cs create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Application/MyCompanyName/ProductManagement/ProductManagementSettings.cs create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Application/ProductManagement.Application.csproj create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain.Shared/ProductManagement.Domain.Shared.csproj create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain.Shared/ProductManagement/Localization/ProductManagementResource.cs create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain.Shared/ProductManagement/ProductManagementDomainErrorCodes.cs create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain.Shared/ProductManagement/ProductManagementDomainSharedModule.cs create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/MyCompanyName/ProductManagement/Localization/Domain/en.json create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/MyCompanyName/ProductManagement/Localization/Domain/pt-BR.json create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/MyCompanyName/ProductManagement/Localization/Domain/zh-Hans.json create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/MyCompanyName/ProductManagement/ProductManagementConsts.cs create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/MyCompanyName/ProductManagement/ProductManagementDomainModule.cs create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/ProductManagement.Domain.csproj create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.EntityFrameworkCore/MyCompanyName/ProductManagement/EntityFrameworkCore/IProductManagementDbContext.cs create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.EntityFrameworkCore/MyCompanyName/ProductManagement/EntityFrameworkCore/ProductManagementDbContext.cs create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.EntityFrameworkCore/MyCompanyName/ProductManagement/EntityFrameworkCore/ProductManagementDbContextModelCreatingExtensions.cs create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.EntityFrameworkCore/MyCompanyName/ProductManagement/EntityFrameworkCore/ProductManagementEntityFrameworkCoreModule.cs create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.EntityFrameworkCore/MyCompanyName/ProductManagement/EntityFrameworkCore/ProductManagementModelBuilderConfigurationOptions.cs create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.EntityFrameworkCore/ProductManagement.EntityFrameworkCore.csproj create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.HttpApi.Client/MyCompanyName/ProductManagement/ProductManagementHttpApiClientModule.cs create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.HttpApi.Client/ProductManagement.HttpApi.Client.csproj create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.HttpApi/MyCompanyName/ProductManagement/ProductManagementHttpApiModule.cs create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.HttpApi/ProductManagement.HttpApi.csproj create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Localization/Resources/ProductManagement/en.json create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Localization/Resources/ProductManagement/pt-BR.json create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Localization/Resources/ProductManagement/zh-Hans.json create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Pages/ProductManagement/_ViewImports.cshtml create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/ProductManagement.Web.csproj create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/ProductManagementMenuContributor.cs create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/ProductManagementWebAutoMapperProfile.cs create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/ProductManagementWebModule.cs create mode 100644 samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Properties/launchSettings.json create mode 100644 samples/MicroserviceDemo/modules/product/test/ProductManagement.Application.Tests/MyCompanyName/ProductManagement/ProductManagementApplicationTestModule.cs create mode 100644 samples/MicroserviceDemo/modules/product/test/ProductManagement.Application.Tests/ProductManagement.Application.Tests.csproj create mode 100644 samples/MicroserviceDemo/modules/product/test/ProductManagement.Domain.Tests/MyCompanyName/ProductManagement/ProductManagementDomainTestBase.cs create mode 100644 samples/MicroserviceDemo/modules/product/test/ProductManagement.Domain.Tests/MyCompanyName/ProductManagement/ProductManagementDomainTestModule.cs create mode 100644 samples/MicroserviceDemo/modules/product/test/ProductManagement.Domain.Tests/ProductManagement.Domain.Tests.csproj create mode 100644 samples/MicroserviceDemo/modules/product/test/ProductManagement.EntityFrameworkCore.Tests/MyCompanyName/ProductManagement/EntityFrameworkCore/MyEntityRepository_Tests.cs create mode 100644 samples/MicroserviceDemo/modules/product/test/ProductManagement.EntityFrameworkCore.Tests/MyCompanyName/ProductManagement/EntityFrameworkCore/ProductManagementEntityFrameworkCoreTestModule.cs create mode 100644 samples/MicroserviceDemo/modules/product/test/ProductManagement.EntityFrameworkCore.Tests/ProductManagement.EntityFrameworkCore.Tests.csproj create mode 100644 samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/MyCompanyName/ProductManagement/MyEntityRepository_Tests.cs create mode 100644 samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/MyCompanyName/ProductManagement/ProductManagementTestBase.cs create mode 100644 samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/MyCompanyName/ProductManagement/ProductManagementTestBaseModule.cs create mode 100644 samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/MyCompanyName/ProductManagement/ProductManagementTestData.cs create mode 100644 samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/MyCompanyName/ProductManagement/ProductManagementTestDataBuilder.cs create mode 100644 samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/ProductManagement.TestBase.csproj diff --git a/samples/MicroserviceDemo/MicroserviceDemo.sln b/samples/MicroserviceDemo/MicroserviceDemo.sln index a7eea46620..253b1f3897 100644 --- a/samples/MicroserviceDemo/MicroserviceDemo.sln +++ b/samples/MicroserviceDemo/MicroserviceDemo.sln @@ -19,6 +19,42 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "consoleclient", "consolecli EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleClientDemo", "applications\consoleclient\ConsoleClientDemo\ConsoleClientDemo.csproj", "{06383443-5840-4C95-A038-A4B9E9211202}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "product", "product", "{DB29DE67-61C2-4B21-BAE3-A9C5A5F04822}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProductService.Host", "microservices\product\ProductService.Host\ProductService.Host.csproj", "{8A3F1AEE-5B54-48AD-8EC7-C2D9339E107C}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "modules", "modules", "{818134CC-2F7F-41B9-ACA6-87F0650F5D52}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "product", "product", "{8FFAECCC-B4A6-4441-AD10-379ADEDD5A19}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F84AC200-1E5A-4FC3-9407-FB2FF527EDA8}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{D1526262-55E0-43F1-9EF1-C6095E76A9E2}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProductManagement.Domain.Shared", "modules\product\src\ProductManagement.Domain.Shared\ProductManagement.Domain.Shared.csproj", "{44A448CC-D8DD-4AA5-861A-78186FC5CE69}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProductManagement.Domain", "modules\product\src\ProductManagement.Domain\ProductManagement.Domain.csproj", "{65593638-9904-424B-831F-F5215EC4312B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProductManagement.Application.Contracts", "modules\product\src\ProductManagement.Application.Contracts\ProductManagement.Application.Contracts.csproj", "{217CD5A1-182F-4D8D-88CA-16DC1EA8525A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProductManagement.Application", "modules\product\src\ProductManagement.Application\ProductManagement.Application.csproj", "{66B2E371-2495-4E76-A6F9-540125C5FB37}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProductManagement.EntityFrameworkCore", "modules\product\src\ProductManagement.EntityFrameworkCore\ProductManagement.EntityFrameworkCore.csproj", "{B22DCAA4-FC9E-4F06-B1BA-41169341B215}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProductManagement.HttpApi", "modules\product\src\ProductManagement.HttpApi\ProductManagement.HttpApi.csproj", "{CFAD2A4B-445A-4EA3-8AF1-C054ECC2DFC5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProductManagement.HttpApi.Client", "modules\product\src\ProductManagement.HttpApi.Client\ProductManagement.HttpApi.Client.csproj", "{4A1C1CF9-74A6-43F9-876C-BB0083EC6FB8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProductManagement.Web", "modules\product\src\ProductManagement.Web\ProductManagement.Web.csproj", "{4A8594CB-8877-412B-9C80-90A5D3366095}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProductManagement.TestBase", "modules\product\test\ProductManagement.TestBase\ProductManagement.TestBase.csproj", "{4D3244F4-487F-4CED-A8C9-E88723EB835A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProductManagement.EntityFrameworkCore.Tests", "modules\product\test\ProductManagement.EntityFrameworkCore.Tests\ProductManagement.EntityFrameworkCore.Tests.csproj", "{1FA2B816-7841-44B0-931C-D4F84DA7E146}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProductManagement.Domain.Tests", "modules\product\test\ProductManagement.Domain.Tests\ProductManagement.Domain.Tests.csproj", "{BDCDBC2D-C05B-4A18-A698-86525E3EFC95}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProductManagement.Application.Tests", "modules\product\test\ProductManagement.Application.Tests\ProductManagement.Application.Tests.csproj", "{B6F469F0-FB01-4A60-B6A6-D4127907E3B6}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -37,6 +73,58 @@ Global {06383443-5840-4C95-A038-A4B9E9211202}.Debug|Any CPU.Build.0 = Debug|Any CPU {06383443-5840-4C95-A038-A4B9E9211202}.Release|Any CPU.ActiveCfg = Release|Any CPU {06383443-5840-4C95-A038-A4B9E9211202}.Release|Any CPU.Build.0 = Release|Any CPU + {8A3F1AEE-5B54-48AD-8EC7-C2D9339E107C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8A3F1AEE-5B54-48AD-8EC7-C2D9339E107C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8A3F1AEE-5B54-48AD-8EC7-C2D9339E107C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8A3F1AEE-5B54-48AD-8EC7-C2D9339E107C}.Release|Any CPU.Build.0 = Release|Any CPU + {44A448CC-D8DD-4AA5-861A-78186FC5CE69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {44A448CC-D8DD-4AA5-861A-78186FC5CE69}.Debug|Any CPU.Build.0 = Debug|Any CPU + {44A448CC-D8DD-4AA5-861A-78186FC5CE69}.Release|Any CPU.ActiveCfg = Release|Any CPU + {44A448CC-D8DD-4AA5-861A-78186FC5CE69}.Release|Any CPU.Build.0 = Release|Any CPU + {65593638-9904-424B-831F-F5215EC4312B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {65593638-9904-424B-831F-F5215EC4312B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {65593638-9904-424B-831F-F5215EC4312B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {65593638-9904-424B-831F-F5215EC4312B}.Release|Any CPU.Build.0 = Release|Any CPU + {217CD5A1-182F-4D8D-88CA-16DC1EA8525A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {217CD5A1-182F-4D8D-88CA-16DC1EA8525A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {217CD5A1-182F-4D8D-88CA-16DC1EA8525A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {217CD5A1-182F-4D8D-88CA-16DC1EA8525A}.Release|Any CPU.Build.0 = Release|Any CPU + {66B2E371-2495-4E76-A6F9-540125C5FB37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {66B2E371-2495-4E76-A6F9-540125C5FB37}.Debug|Any CPU.Build.0 = Debug|Any CPU + {66B2E371-2495-4E76-A6F9-540125C5FB37}.Release|Any CPU.ActiveCfg = Release|Any CPU + {66B2E371-2495-4E76-A6F9-540125C5FB37}.Release|Any CPU.Build.0 = Release|Any CPU + {B22DCAA4-FC9E-4F06-B1BA-41169341B215}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B22DCAA4-FC9E-4F06-B1BA-41169341B215}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B22DCAA4-FC9E-4F06-B1BA-41169341B215}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B22DCAA4-FC9E-4F06-B1BA-41169341B215}.Release|Any CPU.Build.0 = Release|Any CPU + {CFAD2A4B-445A-4EA3-8AF1-C054ECC2DFC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CFAD2A4B-445A-4EA3-8AF1-C054ECC2DFC5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CFAD2A4B-445A-4EA3-8AF1-C054ECC2DFC5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CFAD2A4B-445A-4EA3-8AF1-C054ECC2DFC5}.Release|Any CPU.Build.0 = Release|Any CPU + {4A1C1CF9-74A6-43F9-876C-BB0083EC6FB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4A1C1CF9-74A6-43F9-876C-BB0083EC6FB8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4A1C1CF9-74A6-43F9-876C-BB0083EC6FB8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4A1C1CF9-74A6-43F9-876C-BB0083EC6FB8}.Release|Any CPU.Build.0 = Release|Any CPU + {4A8594CB-8877-412B-9C80-90A5D3366095}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4A8594CB-8877-412B-9C80-90A5D3366095}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4A8594CB-8877-412B-9C80-90A5D3366095}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4A8594CB-8877-412B-9C80-90A5D3366095}.Release|Any CPU.Build.0 = Release|Any CPU + {4D3244F4-487F-4CED-A8C9-E88723EB835A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4D3244F4-487F-4CED-A8C9-E88723EB835A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4D3244F4-487F-4CED-A8C9-E88723EB835A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4D3244F4-487F-4CED-A8C9-E88723EB835A}.Release|Any CPU.Build.0 = Release|Any CPU + {1FA2B816-7841-44B0-931C-D4F84DA7E146}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1FA2B816-7841-44B0-931C-D4F84DA7E146}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1FA2B816-7841-44B0-931C-D4F84DA7E146}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1FA2B816-7841-44B0-931C-D4F84DA7E146}.Release|Any CPU.Build.0 = Release|Any CPU + {BDCDBC2D-C05B-4A18-A698-86525E3EFC95}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BDCDBC2D-C05B-4A18-A698-86525E3EFC95}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BDCDBC2D-C05B-4A18-A698-86525E3EFC95}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BDCDBC2D-C05B-4A18-A698-86525E3EFC95}.Release|Any CPU.Build.0 = Release|Any CPU + {B6F469F0-FB01-4A60-B6A6-D4127907E3B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B6F469F0-FB01-4A60-B6A6-D4127907E3B6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B6F469F0-FB01-4A60-B6A6-D4127907E3B6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B6F469F0-FB01-4A60-B6A6-D4127907E3B6}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -48,6 +136,23 @@ Global {E015158C-BCDB-4890-8B3B-1CEE1FC817CC} = {C53F39BA-7409-4957-8FF8-C04D7377CA62} {72DA455F-4BD5-401D-8B2B-EE20F0C8D1AE} = {8F6834D7-E6FA-4A04-83BB-955F68EA0A0A} {06383443-5840-4C95-A038-A4B9E9211202} = {72DA455F-4BD5-401D-8B2B-EE20F0C8D1AE} + {DB29DE67-61C2-4B21-BAE3-A9C5A5F04822} = {3B26D176-390B-4F51-BE52-E9B422C28A88} + {8A3F1AEE-5B54-48AD-8EC7-C2D9339E107C} = {DB29DE67-61C2-4B21-BAE3-A9C5A5F04822} + {8FFAECCC-B4A6-4441-AD10-379ADEDD5A19} = {818134CC-2F7F-41B9-ACA6-87F0650F5D52} + {F84AC200-1E5A-4FC3-9407-FB2FF527EDA8} = {8FFAECCC-B4A6-4441-AD10-379ADEDD5A19} + {D1526262-55E0-43F1-9EF1-C6095E76A9E2} = {8FFAECCC-B4A6-4441-AD10-379ADEDD5A19} + {44A448CC-D8DD-4AA5-861A-78186FC5CE69} = {F84AC200-1E5A-4FC3-9407-FB2FF527EDA8} + {65593638-9904-424B-831F-F5215EC4312B} = {F84AC200-1E5A-4FC3-9407-FB2FF527EDA8} + {217CD5A1-182F-4D8D-88CA-16DC1EA8525A} = {F84AC200-1E5A-4FC3-9407-FB2FF527EDA8} + {66B2E371-2495-4E76-A6F9-540125C5FB37} = {F84AC200-1E5A-4FC3-9407-FB2FF527EDA8} + {B22DCAA4-FC9E-4F06-B1BA-41169341B215} = {F84AC200-1E5A-4FC3-9407-FB2FF527EDA8} + {CFAD2A4B-445A-4EA3-8AF1-C054ECC2DFC5} = {F84AC200-1E5A-4FC3-9407-FB2FF527EDA8} + {4A1C1CF9-74A6-43F9-876C-BB0083EC6FB8} = {F84AC200-1E5A-4FC3-9407-FB2FF527EDA8} + {4A8594CB-8877-412B-9C80-90A5D3366095} = {F84AC200-1E5A-4FC3-9407-FB2FF527EDA8} + {4D3244F4-487F-4CED-A8C9-E88723EB835A} = {D1526262-55E0-43F1-9EF1-C6095E76A9E2} + {1FA2B816-7841-44B0-931C-D4F84DA7E146} = {D1526262-55E0-43F1-9EF1-C6095E76A9E2} + {BDCDBC2D-C05B-4A18-A698-86525E3EFC95} = {D1526262-55E0-43F1-9EF1-C6095E76A9E2} + {B6F469F0-FB01-4A60-B6A6-D4127907E3B6} = {D1526262-55E0-43F1-9EF1-C6095E76A9E2} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {37474F0D-2E52-4D2F-B39B-7FE3FF31B4EC} diff --git a/samples/MicroserviceDemo/microservices/product/ProductService.Host/ProductService.Host.csproj b/samples/MicroserviceDemo/microservices/product/ProductService.Host/ProductService.Host.csproj new file mode 100644 index 0000000000..845371e352 --- /dev/null +++ b/samples/MicroserviceDemo/microservices/product/ProductService.Host/ProductService.Host.csproj @@ -0,0 +1,37 @@ + + + + netcoreapp2.2 + $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; + true + true + true + true + false + true + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/MicroserviceDemo/microservices/product/ProductService.Host/Program.cs b/samples/MicroserviceDemo/microservices/product/ProductService.Host/Program.cs new file mode 100644 index 0000000000..a3d9e97eca --- /dev/null +++ b/samples/MicroserviceDemo/microservices/product/ProductService.Host/Program.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; + +namespace ProductService.Host +{ + public class Program + { + public static void Main(string[] args) + { + CreateWebHostBuilder(args).Build().Run(); + } + + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup(); + } +} diff --git a/samples/MicroserviceDemo/microservices/product/ProductService.Host/Properties/launchSettings.json b/samples/MicroserviceDemo/microservices/product/ProductService.Host/Properties/launchSettings.json new file mode 100644 index 0000000000..b93ef90918 --- /dev/null +++ b/samples/MicroserviceDemo/microservices/product/ProductService.Host/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:60244", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "ProductService.Host": { + "commandName": "Project", + "launchBrowser": true, + "applicationUrl": "http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/samples/MicroserviceDemo/microservices/product/ProductService.Host/Startup.cs b/samples/MicroserviceDemo/microservices/product/ProductService.Host/Startup.cs new file mode 100644 index 0000000000..8ddcd3dca6 --- /dev/null +++ b/samples/MicroserviceDemo/microservices/product/ProductService.Host/Startup.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.DependencyInjection; + +namespace ProductService.Host +{ + public class Startup + { + // This method gets called by the runtime. Use this method to add services to the container. + // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 + public void ConfigureServices(IServiceCollection services) + { + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.Run(async (context) => + { + await context.Response.WriteAsync("Hello World!"); + }); + } + } +} diff --git a/samples/MicroserviceDemo/microservices/product/ProductService.Host/appsettings.Development.json b/samples/MicroserviceDemo/microservices/product/ProductService.Host/appsettings.Development.json new file mode 100644 index 0000000000..e203e9407e --- /dev/null +++ b/samples/MicroserviceDemo/microservices/product/ProductService.Host/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/samples/MicroserviceDemo/microservices/product/ProductService.Host/appsettings.json b/samples/MicroserviceDemo/microservices/product/ProductService.Host/appsettings.json new file mode 100644 index 0000000000..da1dd42ca3 --- /dev/null +++ b/samples/MicroserviceDemo/microservices/product/ProductService.Host/appsettings.json @@ -0,0 +1,11 @@ +{ + "ConnectionStrings": { + "Default": "Server=localhost;Database=MsDemo_Product;Trusted_Connection=True;MultipleActiveResultSets=true" + }, + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/MyCompanyName/ProductManagement/Localization/ApplicationContracts/en.json b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/MyCompanyName/ProductManagement/Localization/ApplicationContracts/en.json new file mode 100644 index 0000000000..f1c8d8fecd --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/MyCompanyName/ProductManagement/Localization/ApplicationContracts/en.json @@ -0,0 +1,6 @@ +{ + "culture": "en", + "texts": { + "Permission:ProductManagement": "ProductManagement" + } +} \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/MyCompanyName/ProductManagement/Localization/ApplicationContracts/pt-BR.json b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/MyCompanyName/ProductManagement/Localization/ApplicationContracts/pt-BR.json new file mode 100644 index 0000000000..3ae59788be --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/MyCompanyName/ProductManagement/Localization/ApplicationContracts/pt-BR.json @@ -0,0 +1,6 @@ +{ + "culture": "pt-BR", + "texts": { + "Permission:ProductManagement": "ProductManagement" + } +} \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/MyCompanyName/ProductManagement/Localization/ApplicationContracts/zh-Hans.json b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/MyCompanyName/ProductManagement/Localization/ApplicationContracts/zh-Hans.json new file mode 100644 index 0000000000..6df2d5548a --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/MyCompanyName/ProductManagement/Localization/ApplicationContracts/zh-Hans.json @@ -0,0 +1,6 @@ +{ + "culture": "zh-Hans", + "texts": { + "Permission:ProductManagement": "ProductManagement" + } + } \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/MyCompanyName/ProductManagement/ProductManagementApplicationContractsModule.cs b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/MyCompanyName/ProductManagement/ProductManagementApplicationContractsModule.cs new file mode 100644 index 0000000000..f2cf5cf2d8 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/MyCompanyName/ProductManagement/ProductManagementApplicationContractsModule.cs @@ -0,0 +1,37 @@ +using Microsoft.Extensions.DependencyInjection; +using ProductManagement.Localization; +using Volo.Abp.Application; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.VirtualFileSystem; + +namespace ProductManagement +{ + [DependsOn( + typeof(ProductManagementDomainSharedModule), + typeof(AbpDddApplicationModule) + )] + public class ProductManagementApplicationContractsModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.DefinitionProviders.Add(); + }); + + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("/MyCompanyName/ProductManagement/Localization/ApplicationContracts"); + }); + } + } +} diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/MyCompanyName/ProductManagement/ProductManagementPermissionDefinitionProvider.cs b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/MyCompanyName/ProductManagement/ProductManagementPermissionDefinitionProvider.cs new file mode 100644 index 0000000000..5ebc51d258 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/MyCompanyName/ProductManagement/ProductManagementPermissionDefinitionProvider.cs @@ -0,0 +1,19 @@ +using ProductManagement.Localization; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Localization; + +namespace ProductManagement +{ + public class ProductManagementPermissionDefinitionProvider : PermissionDefinitionProvider + { + public override void Define(IPermissionDefinitionContext context) + { + //var moduleGroup = context.AddGroup(ProductManagementPermissions.GroupName, L("Permission:ProductManagement")); + } + + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); + } + } +} \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/MyCompanyName/ProductManagement/ProductManagementPermissions.cs b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/MyCompanyName/ProductManagement/ProductManagementPermissions.cs new file mode 100644 index 0000000000..f804b97815 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/MyCompanyName/ProductManagement/ProductManagementPermissions.cs @@ -0,0 +1,15 @@ +namespace ProductManagement +{ + public class ProductManagementPermissions + { + public const string GroupName = "ProductManagement"; + + public static string[] GetAll() + { + return new[] + { + GroupName + }; + } + } +} \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/ProductManagement.Application.Contracts.csproj b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/ProductManagement.Application.Contracts.csproj new file mode 100644 index 0000000000..d5b19038ca --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/ProductManagement.Application.Contracts.csproj @@ -0,0 +1,21 @@ + + + + netstandard2.0 + + + + + + + + + + + + + + + + + diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application/MyCompanyName/ProductManagement/ProductManagementApplicationAutoMapperProfile.cs b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application/MyCompanyName/ProductManagement/ProductManagementApplicationAutoMapperProfile.cs new file mode 100644 index 0000000000..e42b94e48c --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application/MyCompanyName/ProductManagement/ProductManagementApplicationAutoMapperProfile.cs @@ -0,0 +1,12 @@ +using AutoMapper; + +namespace ProductManagement +{ + public class ProductManagementApplicationAutoMapperProfile : Profile + { + public ProductManagementApplicationAutoMapperProfile() + { + + } + } +} \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application/MyCompanyName/ProductManagement/ProductManagementApplicationModule.cs b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application/MyCompanyName/ProductManagement/ProductManagementApplicationModule.cs new file mode 100644 index 0000000000..a51f104e20 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application/MyCompanyName/ProductManagement/ProductManagementApplicationModule.cs @@ -0,0 +1,28 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.AutoMapper; +using Volo.Abp.Modularity; +using Volo.Abp.Settings; + +namespace ProductManagement +{ + [DependsOn( + typeof(ProductManagementDomainModule), + typeof(ProductManagementApplicationContractsModule), + typeof(AbpAutoMapperModule) + )] + public class ProductManagementApplicationModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.AddProfile(validate: true); + }); + + Configure(options => + { + options.DefinitionProviders.Add(); + }); + } + } +} diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application/MyCompanyName/ProductManagement/ProductManagementSettingDefinitionProvider.cs b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application/MyCompanyName/ProductManagement/ProductManagementSettingDefinitionProvider.cs new file mode 100644 index 0000000000..168e441945 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application/MyCompanyName/ProductManagement/ProductManagementSettingDefinitionProvider.cs @@ -0,0 +1,14 @@ +using Volo.Abp.Settings; + +namespace ProductManagement +{ + public class ProductManagementSettingDefinitionProvider : SettingDefinitionProvider + { + public override void Define(ISettingDefinitionContext context) + { + /* Define module settings here. + * Use names from ProductManagementSettings class. + */ + } + } +} \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application/MyCompanyName/ProductManagement/ProductManagementSettings.cs b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application/MyCompanyName/ProductManagement/ProductManagementSettings.cs new file mode 100644 index 0000000000..19ca732df8 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application/MyCompanyName/ProductManagement/ProductManagementSettings.cs @@ -0,0 +1,11 @@ +namespace ProductManagement +{ + public static class ProductManagementSettings + { + public const string GroupName = "ProductManagement"; + + /* Add constants for setting names. Example: + * public const string MySettingName = GroupName + ".MySettingName"; + */ + } +} \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application/ProductManagement.Application.csproj b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application/ProductManagement.Application.csproj new file mode 100644 index 0000000000..4bb3077928 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application/ProductManagement.Application.csproj @@ -0,0 +1,14 @@ + + + + netstandard2.0 + + + + + + + + + + diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain.Shared/ProductManagement.Domain.Shared.csproj b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain.Shared/ProductManagement.Domain.Shared.csproj new file mode 100644 index 0000000000..e5152da50c --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain.Shared/ProductManagement.Domain.Shared.csproj @@ -0,0 +1,12 @@ + + + + netstandard2.0 + + + + + + + + diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain.Shared/ProductManagement/Localization/ProductManagementResource.cs b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain.Shared/ProductManagement/Localization/ProductManagementResource.cs new file mode 100644 index 0000000000..3720874a2b --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain.Shared/ProductManagement/Localization/ProductManagementResource.cs @@ -0,0 +1,10 @@ +using Volo.Abp.Localization; + +namespace ProductManagement.Localization +{ + [LocalizationResourceName("ProductManagement")] + public class ProductManagementResource + { + + } +} diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain.Shared/ProductManagement/ProductManagementDomainErrorCodes.cs b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain.Shared/ProductManagement/ProductManagementDomainErrorCodes.cs new file mode 100644 index 0000000000..6fe625da76 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain.Shared/ProductManagement/ProductManagementDomainErrorCodes.cs @@ -0,0 +1,7 @@ +namespace ProductManagement +{ + public static class ProductManagementDomainErrorCodes + { + //Add your business exception error codes here... + } +} diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain.Shared/ProductManagement/ProductManagementDomainSharedModule.cs b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain.Shared/ProductManagement/ProductManagementDomainSharedModule.cs new file mode 100644 index 0000000000..8c2230c70c --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain.Shared/ProductManagement/ProductManagementDomainSharedModule.cs @@ -0,0 +1,21 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Modularity; +using Volo.Abp.Localization; +using ProductManagement.Localization; + +namespace ProductManagement +{ + [DependsOn( + typeof(AbpLocalizationModule) + )] + public class ProductManagementDomainSharedModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.Resources.Add("en"); + }); + } + } +} diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/MyCompanyName/ProductManagement/Localization/Domain/en.json b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/MyCompanyName/ProductManagement/Localization/Domain/en.json new file mode 100644 index 0000000000..92e4e9582b --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/MyCompanyName/ProductManagement/Localization/Domain/en.json @@ -0,0 +1,6 @@ +{ + "culture": "en", + "texts": { + + } +} \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/MyCompanyName/ProductManagement/Localization/Domain/pt-BR.json b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/MyCompanyName/ProductManagement/Localization/Domain/pt-BR.json new file mode 100644 index 0000000000..6d746df04c --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/MyCompanyName/ProductManagement/Localization/Domain/pt-BR.json @@ -0,0 +1,6 @@ +{ + "culture": "pt-BR", + "texts": { + + } +} \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/MyCompanyName/ProductManagement/Localization/Domain/zh-Hans.json b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/MyCompanyName/ProductManagement/Localization/Domain/zh-Hans.json new file mode 100644 index 0000000000..e4557f0ad2 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/MyCompanyName/ProductManagement/Localization/Domain/zh-Hans.json @@ -0,0 +1,6 @@ +{ + "culture": "zh-Hans", + "texts": { + + } + } \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/MyCompanyName/ProductManagement/ProductManagementConsts.cs b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/MyCompanyName/ProductManagement/ProductManagementConsts.cs new file mode 100644 index 0000000000..4db4ce710e --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/MyCompanyName/ProductManagement/ProductManagementConsts.cs @@ -0,0 +1,9 @@ +namespace ProductManagement +{ + public static class ProductManagementConsts + { + public const string DefaultDbTablePrefix = "ProductManagement"; + + public const string DefaultDbSchema = null; + } +} diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/MyCompanyName/ProductManagement/ProductManagementDomainModule.cs b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/MyCompanyName/ProductManagement/ProductManagementDomainModule.cs new file mode 100644 index 0000000000..5f7d0009fc --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/MyCompanyName/ProductManagement/ProductManagementDomainModule.cs @@ -0,0 +1,33 @@ +using Microsoft.Extensions.DependencyInjection; +using ProductManagement.Localization; +using Volo.Abp.Localization; +using Volo.Abp.Localization.ExceptionHandling; +using Volo.Abp.Modularity; +using Volo.Abp.VirtualFileSystem; + +namespace ProductManagement +{ + [DependsOn( + typeof(ProductManagementDomainSharedModule) + )] + public class ProductManagementDomainModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + Configure(options => + { + options.Resources.Get().AddVirtualJson("/MyCompanyName/ProductManagement/Localization/Domain"); + }); + + Configure(options => + { + options.MapCodeNamespace("ProductManagement", typeof(ProductManagementResource)); + }); + } + } +} diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/ProductManagement.Domain.csproj b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/ProductManagement.Domain.csproj new file mode 100644 index 0000000000..07c011d408 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/ProductManagement.Domain.csproj @@ -0,0 +1,21 @@ + + + + netstandard2.0 + + + + + + + + + + + + + + + + + diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.EntityFrameworkCore/MyCompanyName/ProductManagement/EntityFrameworkCore/IProductManagementDbContext.cs b/samples/MicroserviceDemo/modules/product/src/ProductManagement.EntityFrameworkCore/MyCompanyName/ProductManagement/EntityFrameworkCore/IProductManagementDbContext.cs new file mode 100644 index 0000000000..f0de764e00 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.EntityFrameworkCore/MyCompanyName/ProductManagement/EntityFrameworkCore/IProductManagementDbContext.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; + +namespace ProductManagement.EntityFrameworkCore +{ + [ConnectionStringName("ProductManagement")] + public interface IProductManagementDbContext : IEfCoreDbContext + { + /* Add DbSet for each Aggregate Root here. Example: + * DbSet Questions { get; } + */ + } +} \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.EntityFrameworkCore/MyCompanyName/ProductManagement/EntityFrameworkCore/ProductManagementDbContext.cs b/samples/MicroserviceDemo/modules/product/src/ProductManagement.EntityFrameworkCore/MyCompanyName/ProductManagement/EntityFrameworkCore/ProductManagementDbContext.cs new file mode 100644 index 0000000000..ba5fd5c1b8 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.EntityFrameworkCore/MyCompanyName/ProductManagement/EntityFrameworkCore/ProductManagementDbContext.cs @@ -0,0 +1,35 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; + +namespace ProductManagement.EntityFrameworkCore +{ + [ConnectionStringName("ProductManagement")] + public class ProductManagementDbContext : AbpDbContext, IProductManagementDbContext + { + public static string TablePrefix { get; set; } = ProductManagementConsts.DefaultDbTablePrefix; + + public static string Schema { get; set; } = ProductManagementConsts.DefaultDbSchema; + + /* Add DbSet for each Aggregate Root here. Example: + * public DbSet Questions { get; set; } + */ + + public ProductManagementDbContext(DbContextOptions options) + : base(options) + { + + } + + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + + builder.ConfigureProductManagement(options => + { + options.TablePrefix = TablePrefix; + options.Schema = Schema; + }); + } + } +} \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.EntityFrameworkCore/MyCompanyName/ProductManagement/EntityFrameworkCore/ProductManagementDbContextModelCreatingExtensions.cs b/samples/MicroserviceDemo/modules/product/src/ProductManagement.EntityFrameworkCore/MyCompanyName/ProductManagement/EntityFrameworkCore/ProductManagementDbContextModelCreatingExtensions.cs new file mode 100644 index 0000000000..a370b228c9 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.EntityFrameworkCore/MyCompanyName/ProductManagement/EntityFrameworkCore/ProductManagementDbContextModelCreatingExtensions.cs @@ -0,0 +1,38 @@ +using System; +using Microsoft.EntityFrameworkCore; +using Volo.Abp; + +namespace ProductManagement.EntityFrameworkCore +{ + public static class ProductManagementDbContextModelCreatingExtensions + { + public static void ConfigureProductManagement( + this ModelBuilder builder, + Action optionsAction = null) + { + Check.NotNull(builder, nameof(builder)); + + var options = new ProductManagementModelBuilderConfigurationOptions(); + + optionsAction?.Invoke(options); + + /* Configure all entities here. Example: + + builder.Entity(b => + { + //Configure table & schema name + //b.ToTable(options.TablePrefix + "Questions", options.Schema); + + //Properties + //b.Property(q => q.Title).IsRequired().HasMaxLength(QuestionConsts.MaxTitleLength); + + //Configure relations + //b.HasMany(question => question.Tags).WithOne().HasForeignKey(qt => qt.QuestionId); + + //Configure indexes + //b.HasIndex(q => q.CreationTime); + }); + */ + } + } +} \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.EntityFrameworkCore/MyCompanyName/ProductManagement/EntityFrameworkCore/ProductManagementEntityFrameworkCoreModule.cs b/samples/MicroserviceDemo/modules/product/src/ProductManagement.EntityFrameworkCore/MyCompanyName/ProductManagement/EntityFrameworkCore/ProductManagementEntityFrameworkCoreModule.cs new file mode 100644 index 0000000000..d6bdfb7b26 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.EntityFrameworkCore/MyCompanyName/ProductManagement/EntityFrameworkCore/ProductManagementEntityFrameworkCoreModule.cs @@ -0,0 +1,23 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.Modularity; + +namespace ProductManagement.EntityFrameworkCore +{ + [DependsOn( + typeof(ProductManagementDomainModule), + typeof(AbpEntityFrameworkCoreModule) + )] + public class ProductManagementEntityFrameworkCoreModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAbpDbContext(options => + { + /* Add custom repositories here. Example: + * options.AddRepository(); + */ + }); + } + } +} \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.EntityFrameworkCore/MyCompanyName/ProductManagement/EntityFrameworkCore/ProductManagementModelBuilderConfigurationOptions.cs b/samples/MicroserviceDemo/modules/product/src/ProductManagement.EntityFrameworkCore/MyCompanyName/ProductManagement/EntityFrameworkCore/ProductManagementModelBuilderConfigurationOptions.cs new file mode 100644 index 0000000000..7fdb8f9532 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.EntityFrameworkCore/MyCompanyName/ProductManagement/EntityFrameworkCore/ProductManagementModelBuilderConfigurationOptions.cs @@ -0,0 +1,18 @@ +using JetBrains.Annotations; +using Volo.Abp.EntityFrameworkCore.Modeling; + +namespace ProductManagement.EntityFrameworkCore +{ + public class ProductManagementModelBuilderConfigurationOptions : ModelBuilderConfigurationOptions + { + public ProductManagementModelBuilderConfigurationOptions( + [NotNull] string tablePrefix = ProductManagementConsts.DefaultDbTablePrefix, + [CanBeNull] string schema = ProductManagementConsts.DefaultDbSchema) + : base( + tablePrefix, + schema) + { + + } + } +} \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.EntityFrameworkCore/ProductManagement.EntityFrameworkCore.csproj b/samples/MicroserviceDemo/modules/product/src/ProductManagement.EntityFrameworkCore/ProductManagement.EntityFrameworkCore.csproj new file mode 100644 index 0000000000..0f0c87fd2a --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.EntityFrameworkCore/ProductManagement.EntityFrameworkCore.csproj @@ -0,0 +1,13 @@ + + + + netstandard2.0 + + + + + + + + + diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.HttpApi.Client/MyCompanyName/ProductManagement/ProductManagementHttpApiClientModule.cs b/samples/MicroserviceDemo/modules/product/src/ProductManagement.HttpApi.Client/MyCompanyName/ProductManagement/ProductManagementHttpApiClientModule.cs new file mode 100644 index 0000000000..5d50859157 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.HttpApi.Client/MyCompanyName/ProductManagement/ProductManagementHttpApiClientModule.cs @@ -0,0 +1,22 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Http.Client; +using Volo.Abp.Modularity; + +namespace ProductManagement +{ + [DependsOn( + typeof(ProductManagementApplicationContractsModule), + typeof(AbpHttpClientModule))] + public class ProductManagementHttpApiClientModule : AbpModule + { + public const string RemoteServiceName = "ProductManagement"; + + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddHttpClientProxies( + typeof(ProductManagementApplicationContractsModule).Assembly, + RemoteServiceName + ); + } + } +} diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.HttpApi.Client/ProductManagement.HttpApi.Client.csproj b/samples/MicroserviceDemo/modules/product/src/ProductManagement.HttpApi.Client/ProductManagement.HttpApi.Client.csproj new file mode 100644 index 0000000000..9fc9605253 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.HttpApi.Client/ProductManagement.HttpApi.Client.csproj @@ -0,0 +1,13 @@ + + + + netstandard2.0 + + + + + + + + + diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.HttpApi/MyCompanyName/ProductManagement/ProductManagementHttpApiModule.cs b/samples/MicroserviceDemo/modules/product/src/ProductManagement.HttpApi/MyCompanyName/ProductManagement/ProductManagementHttpApiModule.cs new file mode 100644 index 0000000000..7f9fe7142c --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.HttpApi/MyCompanyName/ProductManagement/ProductManagementHttpApiModule.cs @@ -0,0 +1,13 @@ +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.Modularity; + +namespace ProductManagement +{ + [DependsOn( + typeof(ProductManagementApplicationContractsModule), + typeof(AbpAspNetCoreMvcModule))] + public class ProductManagementHttpApiModule : AbpModule + { + + } +} diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.HttpApi/ProductManagement.HttpApi.csproj b/samples/MicroserviceDemo/modules/product/src/ProductManagement.HttpApi/ProductManagement.HttpApi.csproj new file mode 100644 index 0000000000..303e86c328 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.HttpApi/ProductManagement.HttpApi.csproj @@ -0,0 +1,13 @@ + + + + netstandard2.0 + + + + + + + + + diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Localization/Resources/ProductManagement/en.json b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Localization/Resources/ProductManagement/en.json new file mode 100644 index 0000000000..92e4e9582b --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Localization/Resources/ProductManagement/en.json @@ -0,0 +1,6 @@ +{ + "culture": "en", + "texts": { + + } +} \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Localization/Resources/ProductManagement/pt-BR.json b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Localization/Resources/ProductManagement/pt-BR.json new file mode 100644 index 0000000000..6d746df04c --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Localization/Resources/ProductManagement/pt-BR.json @@ -0,0 +1,6 @@ +{ + "culture": "pt-BR", + "texts": { + + } +} \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Localization/Resources/ProductManagement/zh-Hans.json b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Localization/Resources/ProductManagement/zh-Hans.json new file mode 100644 index 0000000000..e4557f0ad2 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Localization/Resources/ProductManagement/zh-Hans.json @@ -0,0 +1,6 @@ +{ + "culture": "zh-Hans", + "texts": { + + } + } \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Pages/ProductManagement/_ViewImports.cshtml b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Pages/ProductManagement/_ViewImports.cshtml new file mode 100644 index 0000000000..c1da1f5f10 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Pages/ProductManagement/_ViewImports.cshtml @@ -0,0 +1,4 @@ +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/ProductManagement.Web.csproj b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/ProductManagement.Web.csproj new file mode 100644 index 0000000000..135271bfc6 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/ProductManagement.Web.csproj @@ -0,0 +1,35 @@ + + + + netstandard2.0 + $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; + true + Library + ProductManagement + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/ProductManagementMenuContributor.cs b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/ProductManagementMenuContributor.cs new file mode 100644 index 0000000000..7c2990e87c --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/ProductManagementMenuContributor.cs @@ -0,0 +1,23 @@ +using System.Threading.Tasks; +using Volo.Abp.UI.Navigation; + +namespace ProductManagement +{ + public class ProductManagementMenuContributor : IMenuContributor + { + public async Task ConfigureMenuAsync(MenuConfigurationContext context) + { + if (context.Menu.Name == StandardMenus.Main) + { + await ConfigureMainMenu(context); + } + } + + private Task ConfigureMainMenu(MenuConfigurationContext context) + { + //Add main menu items. + + return Task.CompletedTask; + } + } +} \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/ProductManagementWebAutoMapperProfile.cs b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/ProductManagementWebAutoMapperProfile.cs new file mode 100644 index 0000000000..47656da8cd --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/ProductManagementWebAutoMapperProfile.cs @@ -0,0 +1,12 @@ +using AutoMapper; + +namespace ProductManagement +{ + public class ProductManagementWebAutoMapperProfile : Profile + { + public ProductManagementWebAutoMapperProfile() + { + //Create mappings. + } + } +} \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/ProductManagementWebModule.cs b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/ProductManagementWebModule.cs new file mode 100644 index 0000000000..16e7cf0c76 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/ProductManagementWebModule.cs @@ -0,0 +1,62 @@ +using Localization.Resources.AbpUi; +using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.Extensions.DependencyInjection; +using ProductManagement.Localization; +using Volo.Abp.AspNetCore.Mvc.Localization; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; +using Volo.Abp.AutoMapper; +using Volo.Abp.Localization; +using Volo.Abp.Localization.Resources.AbpValidation; +using Volo.Abp.Modularity; +using Volo.Abp.UI.Navigation; +using Volo.Abp.VirtualFileSystem; + +namespace ProductManagement +{ + [DependsOn(typeof(ProductManagementHttpApiModule))] + [DependsOn(typeof(AbpAspNetCoreMvcUiThemeSharedModule))] + [DependsOn(typeof(AbpAutoMapperModule))] + public class ProductManagementWebModule : AbpModule + { + public override void PreConfigureServices(ServiceConfigurationContext context) + { + context.Services.PreConfigure(options => + { + options.AddAssemblyResource(typeof(ProductManagementResource), typeof(ProductManagementWebModule).Assembly); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.MenuContributors.Add(new ProductManagementMenuContributor()); + }); + + Configure(options => + { + options.FileSets.AddEmbedded("ProductManagement"); + }); + + Configure(options => + { + options.Resources + .Get() + .AddBaseTypes( + typeof(AbpValidationResource), + typeof(AbpUiResource) + ).AddVirtualJson("/Localization/Resources/ProductManagement"); + }); + + Configure(options => + { + options.AddProfile(validate: true); + }); + + Configure(options => + { + //Configure authorization. + }); + } + } +} diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Properties/launchSettings.json b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Properties/launchSettings.json new file mode 100644 index 0000000000..5ca72943eb --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:56993/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "ProductManagement.Web": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "http://localhost:56994/" + } + } +} \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/test/ProductManagement.Application.Tests/MyCompanyName/ProductManagement/ProductManagementApplicationTestModule.cs b/samples/MicroserviceDemo/modules/product/test/ProductManagement.Application.Tests/MyCompanyName/ProductManagement/ProductManagementApplicationTestModule.cs new file mode 100644 index 0000000000..44d801edf7 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/test/ProductManagement.Application.Tests/MyCompanyName/ProductManagement/ProductManagementApplicationTestModule.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Modularity; + +namespace ProductManagement +{ + [DependsOn( + typeof(ProductManagementApplicationModule), + typeof(ProductManagementDomainTestModule) + )] + public class ProductManagementApplicationTestModule : AbpModule + { + + } +} diff --git a/samples/MicroserviceDemo/modules/product/test/ProductManagement.Application.Tests/ProductManagement.Application.Tests.csproj b/samples/MicroserviceDemo/modules/product/test/ProductManagement.Application.Tests/ProductManagement.Application.Tests.csproj new file mode 100644 index 0000000000..b2120e55fd --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/test/ProductManagement.Application.Tests/ProductManagement.Application.Tests.csproj @@ -0,0 +1,17 @@ + + + + netcoreapp2.2 + + + + + + + + + + + + + diff --git a/samples/MicroserviceDemo/modules/product/test/ProductManagement.Domain.Tests/MyCompanyName/ProductManagement/ProductManagementDomainTestBase.cs b/samples/MicroserviceDemo/modules/product/test/ProductManagement.Domain.Tests/MyCompanyName/ProductManagement/ProductManagementDomainTestBase.cs new file mode 100644 index 0000000000..517bc71e6b --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/test/ProductManagement.Domain.Tests/MyCompanyName/ProductManagement/ProductManagementDomainTestBase.cs @@ -0,0 +1,7 @@ +namespace ProductManagement +{ + public abstract class ProductManagementDomainTestBase : ProductManagementTestBase + { + + } +} \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/test/ProductManagement.Domain.Tests/MyCompanyName/ProductManagement/ProductManagementDomainTestModule.cs b/samples/MicroserviceDemo/modules/product/test/ProductManagement.Domain.Tests/MyCompanyName/ProductManagement/ProductManagementDomainTestModule.cs new file mode 100644 index 0000000000..ce2d52ef8b --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/test/ProductManagement.Domain.Tests/MyCompanyName/ProductManagement/ProductManagementDomainTestModule.cs @@ -0,0 +1,13 @@ +using ProductManagement.EntityFrameworkCore; +using Volo.Abp.Modularity; + +namespace ProductManagement +{ + [DependsOn( + typeof(ProductManagementEntityFrameworkCoreTestModule) + )] + public class ProductManagementDomainTestModule : AbpModule + { + + } +} diff --git a/samples/MicroserviceDemo/modules/product/test/ProductManagement.Domain.Tests/ProductManagement.Domain.Tests.csproj b/samples/MicroserviceDemo/modules/product/test/ProductManagement.Domain.Tests/ProductManagement.Domain.Tests.csproj new file mode 100644 index 0000000000..3ded6d04b1 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/test/ProductManagement.Domain.Tests/ProductManagement.Domain.Tests.csproj @@ -0,0 +1,16 @@ + + + + netcoreapp2.2 + + + + + + + + + + + + diff --git a/samples/MicroserviceDemo/modules/product/test/ProductManagement.EntityFrameworkCore.Tests/MyCompanyName/ProductManagement/EntityFrameworkCore/MyEntityRepository_Tests.cs b/samples/MicroserviceDemo/modules/product/test/ProductManagement.EntityFrameworkCore.Tests/MyCompanyName/ProductManagement/EntityFrameworkCore/MyEntityRepository_Tests.cs new file mode 100644 index 0000000000..11195d30a0 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/test/ProductManagement.EntityFrameworkCore.Tests/MyCompanyName/ProductManagement/EntityFrameworkCore/MyEntityRepository_Tests.cs @@ -0,0 +1,7 @@ +namespace ProductManagement.EntityFrameworkCore +{ + public class MyEntityRepository_Tests : MyEntityRepository_Tests + { + + } +} diff --git a/samples/MicroserviceDemo/modules/product/test/ProductManagement.EntityFrameworkCore.Tests/MyCompanyName/ProductManagement/EntityFrameworkCore/ProductManagementEntityFrameworkCoreTestModule.cs b/samples/MicroserviceDemo/modules/product/test/ProductManagement.EntityFrameworkCore.Tests/MyCompanyName/ProductManagement/EntityFrameworkCore/ProductManagementEntityFrameworkCoreTestModule.cs new file mode 100644 index 0000000000..cb98e6de9d --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/test/ProductManagement.EntityFrameworkCore.Tests/MyCompanyName/ProductManagement/EntityFrameworkCore/ProductManagementEntityFrameworkCoreTestModule.cs @@ -0,0 +1,42 @@ +using Microsoft.Data.Sqlite; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.Modularity; + +namespace ProductManagement.EntityFrameworkCore +{ + [DependsOn( + typeof(ProductManagementTestBaseModule), + typeof(ProductManagementEntityFrameworkCoreModule) + )] + public class ProductManagementEntityFrameworkCoreTestModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + var sqliteConnection = CreateDatabaseAndGetConnection(); + + Configure(options => + { + options.Configure(abpDbContextConfigurationContext => + { + abpDbContextConfigurationContext.DbContextOptions.UseSqlite(sqliteConnection); + }); + }); + } + + private static SqliteConnection CreateDatabaseAndGetConnection() + { + var connection = new SqliteConnection("Data Source=:memory:"); + connection.Open(); + + new ProductManagementDbContext( + new DbContextOptionsBuilder().UseSqlite(connection).Options + ).GetService().CreateTables(); + + return connection; + } + } +} diff --git a/samples/MicroserviceDemo/modules/product/test/ProductManagement.EntityFrameworkCore.Tests/ProductManagement.EntityFrameworkCore.Tests.csproj b/samples/MicroserviceDemo/modules/product/test/ProductManagement.EntityFrameworkCore.Tests/ProductManagement.EntityFrameworkCore.Tests.csproj new file mode 100644 index 0000000000..d322f0e7b3 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/test/ProductManagement.EntityFrameworkCore.Tests/ProductManagement.EntityFrameworkCore.Tests.csproj @@ -0,0 +1,20 @@ + + + + netcoreapp2.2 + + + + + + + + + + + + + + + + diff --git a/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/MyCompanyName/ProductManagement/MyEntityRepository_Tests.cs b/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/MyCompanyName/ProductManagement/MyEntityRepository_Tests.cs new file mode 100644 index 0000000000..a985263bf6 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/MyCompanyName/ProductManagement/MyEntityRepository_Tests.cs @@ -0,0 +1,16 @@ +using System.Threading.Tasks; +using Volo.Abp.Modularity; +using Xunit; + +namespace ProductManagement +{ + public abstract class MyEntityRepository_Tests : ProductManagementTestBase + where TStartupModule : IAbpModule + { + [Fact] + public async Task Test1() + { + + } + } +} diff --git a/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/MyCompanyName/ProductManagement/ProductManagementTestBase.cs b/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/MyCompanyName/ProductManagement/ProductManagementTestBase.cs new file mode 100644 index 0000000000..a36766b724 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/MyCompanyName/ProductManagement/ProductManagementTestBase.cs @@ -0,0 +1,14 @@ +using Volo.Abp; +using Volo.Abp.Modularity; + +namespace ProductManagement +{ + public abstract class ProductManagementTestBase : AbpIntegratedTest + where TStartupModule : IAbpModule + { + protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) + { + options.UseAutofac(); + } + } +} diff --git a/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/MyCompanyName/ProductManagement/ProductManagementTestBaseModule.cs b/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/MyCompanyName/ProductManagement/ProductManagementTestBaseModule.cs new file mode 100644 index 0000000000..c2ced37bbc --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/MyCompanyName/ProductManagement/ProductManagementTestBaseModule.cs @@ -0,0 +1,37 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Authorization; +using Volo.Abp.Autofac; +using Volo.Abp.Modularity; + +namespace ProductManagement +{ + [DependsOn( + typeof(AbpAutofacModule), + typeof(AbpTestBaseModule), + typeof(AbpAuthorizationModule), + typeof(ProductManagementDomainModule) + )] + public class ProductManagementTestBaseModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAlwaysAllowAuthorization(); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + SeedTestData(context); + } + + private static void SeedTestData(ApplicationInitializationContext context) + { + using (var scope = context.ServiceProvider.CreateScope()) + { + scope.ServiceProvider + .GetRequiredService() + .Build(); + } + } + } +} diff --git a/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/MyCompanyName/ProductManagement/ProductManagementTestData.cs b/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/MyCompanyName/ProductManagement/ProductManagementTestData.cs new file mode 100644 index 0000000000..31fe9f75bd --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/MyCompanyName/ProductManagement/ProductManagementTestData.cs @@ -0,0 +1,8 @@ +using Volo.Abp.DependencyInjection; + +namespace ProductManagement +{ + public class ProductManagementTestData : ISingletonDependency + { + } +} diff --git a/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/MyCompanyName/ProductManagement/ProductManagementTestDataBuilder.cs b/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/MyCompanyName/ProductManagement/ProductManagementTestDataBuilder.cs new file mode 100644 index 0000000000..151be4308b --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/MyCompanyName/ProductManagement/ProductManagementTestDataBuilder.cs @@ -0,0 +1,24 @@ +using Volo.Abp.DependencyInjection; +using Volo.Abp.Guids; + +namespace ProductManagement +{ + public class ProductManagementTestDataBuilder : ITransientDependency + { + private readonly IGuidGenerator _guidGenerator; + private ProductManagementTestData _testData; + + public ProductManagementTestDataBuilder( + IGuidGenerator guidGenerator, + ProductManagementTestData testData) + { + _guidGenerator = guidGenerator; + _testData = testData; + } + + public void Build() + { + + } + } +} \ No newline at end of file diff --git a/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/ProductManagement.TestBase.csproj b/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/ProductManagement.TestBase.csproj new file mode 100644 index 0000000000..475346d060 --- /dev/null +++ b/samples/MicroserviceDemo/modules/product/test/ProductManagement.TestBase/ProductManagement.TestBase.csproj @@ -0,0 +1,24 @@ + + + + netcoreapp2.2 + + + + + + + + + + + + + + + + + + + +