Browse Source

Revise service template.

pull/1156/head
Halil ibrahim Kalkan 7 years ago
parent
commit
d2d87c5312
  1. 1
      templates/mvc/src/MyCompanyName.MyProjectName.DbMigrator/MyCompanyName.MyProjectName.DbMigrator.csproj
  2. 3
      templates/mvc/src/MyCompanyName.MyProjectName.DbMigrator/MyProjectNameDbMigratorModule.cs
  3. 2
      templates/mvc/src/MyCompanyName.MyProjectName.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs
  4. 2
      templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyProjectNameDomainModule.cs
  5. 4
      templates/mvc/src/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj
  6. 10
      templates/mvc/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs
  7. 5
      templates/mvc/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs
  8. 2
      templates/mvc/src/MyCompanyName.MyProjectName.Web.Host/Menus/MyProjectNameMenuContributor.cs
  9. 8
      templates/mvc/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs
  10. 2
      templates/mvc/src/MyCompanyName.MyProjectName.Web/Menus/MyProjectNameMenuContributor.cs
  11. 6
      templates/mvc/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs
  12. 3
      templates/service/.gitignore
  13. 14
      templates/service/MyCompanyName.MyProjectName.sln
  14. 22
      templates/service/host/ConsoleClient/ClientDemoService.cs
  15. 17
      templates/service/host/ConsoleClient/ConsoleClient.csproj
  16. 15
      templates/service/host/ConsoleClient/MyProjectNameConsoleApiClientModule.cs
  17. 48
      templates/service/host/ConsoleClient/Program.cs
  18. 18
      templates/service/host/ConsoleClient/appsettings.json
  19. 6
      templates/service/host/IdentityServerHost/EntityFrameworkCore/IdentityServerHostMigrationsDbContext.cs
  20. 10
      templates/service/host/IdentityServerHost/EntityFrameworkCore/IdentityServerHostMigrationsDbContextFactory.cs
  21. 203
      templates/service/host/IdentityServerHost/IdentityServerDataSeedContributor.cs
  22. 109
      templates/service/host/IdentityServerHost/IdentityServerDataSeeder.cs
  23. 14
      templates/service/host/IdentityServerHost/IdentityServerHost.csproj
  24. 70
      templates/service/host/IdentityServerHost/IdentityServerHostModule.cs
  25. 1227
      templates/service/host/IdentityServerHost/Migrations/20190410095119_Initial.Designer.cs
  26. 921
      templates/service/host/IdentityServerHost/Migrations/20190410095119_Initial.cs
  27. 1225
      templates/service/host/IdentityServerHost/Migrations/DemoAppDbContextModelSnapshot.cs
  28. 9
      templates/service/host/IdentityServerHost/MultiTenancy/MultiTenancyConsts.cs
  29. 4
      templates/service/host/IdentityServerHost/Program.cs
  30. 14
      templates/service/host/IdentityServerHost/appsettings.json
  31. 29
      templates/service/host/MyCompanyName.MyProjectName.Host/DemoAppDbContext.cs
  32. 343
      templates/service/host/MyCompanyName.MyProjectName.Host/Logs/logs.txt
  33. 302
      templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20190410095222_Initial.Designer.cs
  34. 212
      templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20190410095222_Initial.cs
  35. 300
      templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/DemoAppDbContextModelSnapshot.cs
  36. 1
      templates/service/host/MyCompanyName.MyProjectName.Host/_CreateSqlServerCacheDatabase.bat
  37. 15
      templates/service/host/MyCompanyName.MyProjectName.Host/appsettings.json
  38. 2
      templates/service/host/MyCompanyName.MyProjectName.HttpApi.Host/Controllers/HomeController.cs
  39. 0
      templates/service/host/MyCompanyName.MyProjectName.HttpApi.Host/Dockerfile
  40. 21
      templates/service/host/MyCompanyName.MyProjectName.HttpApi.Host/EntityFrameworkCore/MyProjectHttpApiHostMigrationsDbContext.cs
  41. 10
      templates/service/host/MyCompanyName.MyProjectName.HttpApi.Host/EntityFrameworkCore/MyProjectHttpApiHostMigrationsDbContextFactory.cs
  42. 9
      templates/service/host/MyCompanyName.MyProjectName.HttpApi.Host/MultiTenancy/MultiTenancyConsts.cs
  43. 28
      templates/service/host/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj
  44. 72
      templates/service/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs
  45. 6
      templates/service/host/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs
  46. 0
      templates/service/host/MyCompanyName.MyProjectName.HttpApi.Host/Properties/launchSettings.json
  47. 4
      templates/service/host/MyCompanyName.MyProjectName.HttpApi.Host/Startup.cs
  48. 12
      templates/service/host/MyCompanyName.MyProjectName.HttpApi.Host/appsettings.json
  49. 0
      templates/service/host/MyCompanyName.MyProjectName.HttpApi.Host/yarn.lock

1
templates/mvc/src/MyCompanyName.MyProjectName.DbMigrator/MyCompanyName.MyProjectName.DbMigrator.csproj

@ -26,6 +26,7 @@
<ItemGroup>
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\MyCompanyName.MyProjectName.Application.Contracts\MyCompanyName.MyProjectName.Application.Contracts.csproj" />
<ProjectReference Include="..\MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations\MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations.csproj" />
</ItemGroup>

3
templates/mvc/src/MyCompanyName.MyProjectName.DbMigrator/MyProjectNameDbMigratorModule.cs

@ -6,7 +6,8 @@ namespace MyCompanyName.MyProjectName.DbMigrator
{
[DependsOn(
typeof(AbpAutofacModule),
typeof(MyProjectNameEntityFrameworkCoreDbMigrationsModule)
typeof(MyProjectNameEntityFrameworkCoreDbMigrationsModule),
typeof(MyProjectNameApplicationContractsModule)
)]
public class MyProjectNameDbMigratorModule : AbpModule
{

2
templates/mvc/src/MyCompanyName.MyProjectName.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs

@ -6,6 +6,6 @@
* If you will never need to multi-tenancy, you can remove
* related modules and code parts, including this file.
*/
public const bool IsMultiTenancyEnabled = true;
public const bool IsEnabled = true;
}
}

2
templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyProjectNameDomainModule.cs

@ -31,7 +31,7 @@ namespace MyCompanyName.MyProjectName
{
Configure<MultiTenancyOptions>(options =>
{
options.IsEnabled = MultiTenancyConsts.IsMultiTenancyEnabled;
options.IsEnabled = MultiTenancyConsts.IsEnabled;
});
}
}

4
templates/mvc/src/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj

@ -16,11 +16,11 @@
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="2.7.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Redis" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="2.2.0" />
<ProjectReference Include="..\..\..\..\..\abp\framework\src\Volo.Abp.AspNetCore.MultiTenancy\Volo.Abp.AspNetCore.MultiTenancy.csproj" />
<ProjectReference Include="..\..\..\..\..\abp\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\abp\framework\src\Volo.Abp.AspNetCore.MultiTenancy\Volo.Abp.AspNetCore.MultiTenancy.csproj" />
<ProjectReference Include="..\..\..\..\..\abp\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\MyCompanyName.MyProjectName.Application\MyCompanyName.MyProjectName.Application.csproj" />
<ProjectReference Include="..\MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations\MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations.csproj" />
<ProjectReference Include="..\MyCompanyName.MyProjectName.HttpApi\MyCompanyName.MyProjectName.HttpApi.csproj" />

10
templates/mvc/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs

@ -48,10 +48,10 @@ namespace MyCompanyName.MyProjectName
{
Configure<VirtualFileSystemOptions>(options =>
{
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameDomainSharedModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}MyCompanyName.MyProjectName.Domain.Shared", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameDomainModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}MyCompanyName.MyProjectName.Domain", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameApplicationContractsModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}MyCompanyName.MyProjectName.Application.Contracts", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameApplicationModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}MyCompanyName.MyProjectName.Application", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameDomainSharedModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}MyCompanyName.MyProjectName.Domain.Shared", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameDomainModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}MyCompanyName.MyProjectName.Domain", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameApplicationContractsModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}MyCompanyName.MyProjectName.Application.Contracts", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameApplicationModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}MyCompanyName.MyProjectName.Application", Path.DirectorySeparatorChar)));
});
}
}
@ -121,7 +121,7 @@ namespace MyCompanyName.MyProjectName
app.UseVirtualFiles();
app.UseAuthentication();
if (MultiTenancyConsts.IsMultiTenancyEnabled)
if (MultiTenancyConsts.IsEnabled)
{
app.UseMultiTenancy();
}

5
templates/mvc/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs

@ -62,6 +62,7 @@ namespace MyCompanyName.MyProjectName
{
Configure<VirtualFileSystemOptions>(options =>
{
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameDomainSharedModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}MyCompanyName.MyProjectName.Domain.Shared", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameDomainModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}MyCompanyName.MyProjectName.Domain", Path.DirectorySeparatorChar)));
//<TEMPLATE-REMOVE>
options.FileSets.ReplaceEmbeddedByPhysical<AbpUiModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.UI", Path.DirectorySeparatorChar)));
@ -105,12 +106,10 @@ namespace MyCompanyName.MyProjectName
app.UseCorrelationId();
app.UseVirtualFiles();
app.UseAuthentication();
if (MultiTenancyConsts.IsMultiTenancyEnabled)
if (MultiTenancyConsts.IsEnabled)
{
app.UseMultiTenancy();
}
app.UseIdentityServer();
app.UseAbpRequestLocalization();
app.UseAuditing();

2
templates/mvc/src/MyCompanyName.MyProjectName.Web.Host/Menus/MyProjectNameMenuContributor.cs

@ -20,7 +20,7 @@ namespace MyCompanyName.MyProjectName.Menus
private async Task ConfigureMainMenuAsync(MenuConfigurationContext context)
{
if (!MultiTenancyConsts.IsMultiTenancyEnabled)
if (!MultiTenancyConsts.IsEnabled)
{
var administration = context.Menu.GetAdministration();
administration.TryRemoveMenuItem(TenantManagementMenuNames.GroupName);

8
templates/mvc/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs

@ -87,7 +87,10 @@ namespace MyCompanyName.MyProjectName
private void ConfigureMultiTenancy()
{
Configure<MultiTenancyOptions>(options => { options.IsEnabled = MultiTenancyConsts.IsMultiTenancyEnabled; });
Configure<MultiTenancyOptions>(options =>
{
options.IsEnabled = MultiTenancyConsts.IsEnabled;
});
}
private void ConfigureAuthentication(ServiceConfigurationContext context, IConfigurationRoot configuration)
@ -143,6 +146,7 @@ namespace MyCompanyName.MyProjectName
Configure<VirtualFileSystemOptions>(options =>
{
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameDomainSharedModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}MyCompanyName.MyProjectName.Domain", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameApplicationContractsModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}MyCompanyName.MyProjectName.Application.Contracts", Path.DirectorySeparatorChar)));
//<TEMPLATE-REMOVE>
options.FileSets.ReplaceEmbeddedByPhysical<AbpUiModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.UI", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.AspNetCore.Mvc.UI", Path.DirectorySeparatorChar)));
@ -212,7 +216,7 @@ namespace MyCompanyName.MyProjectName
app.UseVirtualFiles();
app.UseAuthentication();
if (MultiTenancyConsts.IsMultiTenancyEnabled)
if (MultiTenancyConsts.IsEnabled)
{
app.UseMultiTenancy();
}

2
templates/mvc/src/MyCompanyName.MyProjectName.Web/Menus/MyProjectNameMenuContributor.cs

@ -20,7 +20,7 @@ namespace MyCompanyName.MyProjectName.Menus
private async Task ConfigureMainMenuAsync(MenuConfigurationContext context)
{
if (!MultiTenancyConsts.IsMultiTenancyEnabled)
if (!MultiTenancyConsts.IsEnabled)
{
var administration = context.Menu.GetAdministration();
administration.TryRemoveMenuItem(TenantManagementMenuNames.GroupName);

6
templates/mvc/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs

@ -112,6 +112,10 @@ namespace MyCompanyName.MyProjectName
Configure<VirtualFileSystemOptions>(options =>
{
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameDomainSharedModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}MyCompanyName.MyProjectName.Domain.Shared", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameDomainModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}MyCompanyName.MyProjectName.Domain", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameApplicationContractsModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}MyCompanyName.MyProjectName.Application.Contracts", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameApplicationModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}MyCompanyName.MyProjectName.Application", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameWebModule>(hostingEnvironment.ContentRootPath);
//<TEMPLATE-REMOVE>
options.FileSets.ReplaceEmbeddedByPhysical<AbpUiModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.UI", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.AspNetCore.Mvc.UI", Path.DirectorySeparatorChar)));
@ -189,7 +193,7 @@ namespace MyCompanyName.MyProjectName
app.UseAuthentication();
app.UseJwtTokenMiddleware();
if (MultiTenancyConsts.IsMultiTenancyEnabled)
if (MultiTenancyConsts.IsEnabled)
{
app.UseMultiTenancy();
}

3
templates/service/.gitignore

@ -252,4 +252,5 @@ paket-files/
*.sln.iml
# MyProjectName
src/MyCompanyName.MyProjectName.Web/Logs/logs.txt
host/IdentityServerHost/Logs/logs.txt
host/MyCompanyName.MyProjectName.HttpApi.Host/Logs/logs.txt

14
templates/service/MyCompanyName.MyProjectName.sln

@ -25,8 +25,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName.HttpApi.Client", "src\MyCompanyName.MyProjectName.HttpApi.Client\MyCompanyName.MyProjectName.HttpApi.Client.csproj", "{36E2735F-CEAB-44C8-A6D1-2CDAFF399751}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName.Host", "host\MyCompanyName.MyProjectName.Host\MyCompanyName.MyProjectName.Host.csproj", "{E7353C9A-4357-4A40-A39A-52B73F5A0CA1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IdentityServerHost", "host\IdentityServerHost\IdentityServerHost.csproj", "{3F3E0DCA-DA28-42FA-ABC8-F49E5A920D68}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleClient", "host\ConsoleClient\ConsoleClient.csproj", "{2A9E859C-BB5A-4A10-BB33-97ECBF10A8C8}"
@ -41,6 +39,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName.Application.Tests", "test\MyCompanyName.MyProjectName.Application.Tests\MyCompanyName.MyProjectName.Application.Tests.csproj", "{90CB5DC4-C040-45C7-8900-9688B26405BC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName.HttpApi.Host", "host\MyCompanyName.MyProjectName.HttpApi.Host\MyCompanyName.MyProjectName.HttpApi.Host.csproj", "{37B135B0-DAFE-4616-B25C-1BDF32FC44A2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -79,10 +79,6 @@ Global
{36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Debug|Any CPU.Build.0 = Debug|Any CPU
{36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Release|Any CPU.ActiveCfg = Release|Any CPU
{36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Release|Any CPU.Build.0 = Release|Any CPU
{E7353C9A-4357-4A40-A39A-52B73F5A0CA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E7353C9A-4357-4A40-A39A-52B73F5A0CA1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E7353C9A-4357-4A40-A39A-52B73F5A0CA1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E7353C9A-4357-4A40-A39A-52B73F5A0CA1}.Release|Any CPU.Build.0 = Release|Any CPU
{3F3E0DCA-DA28-42FA-ABC8-F49E5A920D68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3F3E0DCA-DA28-42FA-ABC8-F49E5A920D68}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3F3E0DCA-DA28-42FA-ABC8-F49E5A920D68}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -111,6 +107,10 @@ Global
{90CB5DC4-C040-45C7-8900-9688B26405BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{90CB5DC4-C040-45C7-8900-9688B26405BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{90CB5DC4-C040-45C7-8900-9688B26405BC}.Release|Any CPU.Build.0 = Release|Any CPU
{37B135B0-DAFE-4616-B25C-1BDF32FC44A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{37B135B0-DAFE-4616-B25C-1BDF32FC44A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{37B135B0-DAFE-4616-B25C-1BDF32FC44A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{37B135B0-DAFE-4616-B25C-1BDF32FC44A2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -124,7 +124,6 @@ Global
{F1C58097-4C08-4D88-8976-6B3389391481} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545}
{077AA5F8-8B61-420C-A6B5-0150A66FDB34} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545}
{36E2735F-CEAB-44C8-A6D1-2CDAFF399751} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545}
{E7353C9A-4357-4A40-A39A-52B73F5A0CA1} = {E400416D-2895-4512-9D17-90681EEC7E0A}
{3F3E0DCA-DA28-42FA-ABC8-F49E5A920D68} = {E400416D-2895-4512-9D17-90681EEC7E0A}
{2A9E859C-BB5A-4A10-BB33-97ECBF10A8C8} = {E400416D-2895-4512-9D17-90681EEC7E0A}
{C5BB573D-3030-4BCB-88B7-F6A85C32766C} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}
@ -132,6 +131,7 @@ Global
{D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}
{E60895E5-79C4-447D-88B7-85CB5BA336A4} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}
{90CB5DC4-C040-45C7-8900-9688B26405BC} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}
{37B135B0-DAFE-4616-B25C-1BDF32FC44A2} = {E400416D-2895-4512-9D17-90681EEC7E0A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4324B3B4-B60B-4E3C-91D8-59576B4E26DD}

22
templates/service/host/ConsoleClient/ClientDemoService.cs

@ -0,0 +1,22 @@
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
namespace ConsoleClient
{
public class ClientDemoService : ITransientDependency
{
//private readonly ISampleAppService _sampleAppService;
public ClientDemoService(
//ISampleAppService sampleAppService
)
{
//_sampleAppService = sampleAppService;
}
public async Task RunAsync()
{
//var output = await _sampleAppService.Method1Async();
}
}
}

17
templates/service/host/ConsoleClient/ConsoleClient.csproj

@ -6,7 +6,22 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="IdentityModel" Version="3.10.1" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Http.Client.IdentityModel\Volo.Abp.Http.Client.IdentityModel.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\MyCompanyName.MyProjectName.HttpApi.Client\MyCompanyName.MyProjectName.HttpApi.Client.csproj" />
</ItemGroup>
<ItemGroup>
<None Remove="appsettings.json" />
</ItemGroup>
<ItemGroup>
<Content Include="appsettings.json">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>

15
templates/service/host/ConsoleClient/MyProjectNameConsoleApiClientModule.cs

@ -0,0 +1,15 @@
using MyCompanyName.MyProjectName;
using Volo.Abp.Http.Client.IdentityModel;
using Volo.Abp.Modularity;
namespace ConsoleClient
{
[DependsOn(
typeof(MyProjectNameHttpApiClientModule),
typeof(AbpHttpClientIdentityModelModule)
)]
public class MyProjectNameConsoleApiClientModule : AbpModule
{
}
}

48
templates/service/host/ConsoleClient/Program.cs

@ -1,7 +1,7 @@
using System;
using System.Net.Http;
using System.Threading.Tasks;
using IdentityModel.Client;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp;
using Volo.Abp.Threading;
namespace ConsoleClient
{
@ -9,45 +9,15 @@ namespace ConsoleClient
{
static void Main(string[] args)
{
RunDemo().Wait();
Console.ReadLine();
}
private static async Task RunDemo()
{
// discover endpoints from metadata
var disco = await DiscoveryClient.GetAsync("http://localhost:61517");
if (disco.IsError)
{
Console.WriteLine(disco.Error);
return;
}
// request token
var tokenClient = new TokenClient(disco.TokenEndpoint, "test-client", "secret");
var tokenResponse = await tokenClient.RequestClientCredentialsAsync("api1");
if (tokenResponse.IsError)
using (var application = AbpApplicationFactory.Create<MyProjectNameConsoleApiClientModule>())
{
Console.WriteLine(tokenResponse.Error);
return;
}
Console.WriteLine(tokenResponse.Json);
application.Initialize();
// call api
var client = new HttpClient();
client.SetBearerToken(tokenResponse.AccessToken);
var demo = application.ServiceProvider.GetRequiredService<ClientDemoService>();
AsyncHelper.RunSync(() => demo.RunAsync());
var response = await client.GetAsync("http://localhost:57992/api/MyProjectName/todos/");
if (!response.IsSuccessStatusCode)
{
Console.WriteLine(response.StatusCode);
}
else
{
var content = await response.Content.ReadAsStringAsync();
Console.WriteLine(content);
Console.WriteLine("Press ENTER to stop application...");
Console.ReadLine();
}
}
}

18
templates/service/host/ConsoleClient/appsettings.json

@ -0,0 +1,18 @@
{
"RemoteServices": {
"Default": {
"BaseUrl": "https://localhost:44395/"
}
},
"IdentityClients": {
"Default": {
"GrantType": "password",
"ClientId": "MyProjectName_ConsoleTestApp",
"ClientSecret": "1q2w3e*",
"UserName": "admin",
"UserPassword": "1q2w3E*",
"Authority": "https://localhost:44348",
"Scope": "MyProjectName"
}
}
}

6
templates/service/host/IdentityServerHost/DemoAppDbContext.cs → templates/service/host/IdentityServerHost/EntityFrameworkCore/IdentityServerHostMigrationsDbContext.cs

@ -6,11 +6,11 @@ using Volo.Abp.IdentityServer.EntityFrameworkCore;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.SettingManagement.EntityFrameworkCore;
namespace IdentityServerHost
namespace IdentityServerHost.EntityFrameworkCore
{
public class DemoAppDbContext : AbpDbContext<DemoAppDbContext>
public class IdentityServerHostMigrationsDbContext : AbpDbContext<IdentityServerHostMigrationsDbContext>
{
public DemoAppDbContext(DbContextOptions<DemoAppDbContext> options)
public IdentityServerHostMigrationsDbContext(DbContextOptions<IdentityServerHostMigrationsDbContext> options)
: base(options)
{

10
templates/service/host/IdentityServerHost/DemoAppDbContextFactory.cs → templates/service/host/IdentityServerHost/EntityFrameworkCore/IdentityServerHostMigrationsDbContextFactory.cs

@ -3,18 +3,18 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.Extensions.Configuration;
namespace IdentityServerHost
namespace IdentityServerHost.EntityFrameworkCore
{
public class DemoAppDbContextFactory : IDesignTimeDbContextFactory<DemoAppDbContext>
public class IdentityServerHostMigrationsDbContextFactory : IDesignTimeDbContextFactory<IdentityServerHostMigrationsDbContext>
{
public DemoAppDbContext CreateDbContext(string[] args)
public IdentityServerHostMigrationsDbContext CreateDbContext(string[] args)
{
var configuration = BuildConfiguration();
var builder = new DbContextOptionsBuilder<DemoAppDbContext>()
var builder = new DbContextOptionsBuilder<IdentityServerHostMigrationsDbContext>()
.UseSqlServer(configuration.GetConnectionString("Default"));
return new DemoAppDbContext(builder.Options);
return new IdentityServerHostMigrationsDbContext(builder.Options);
}
private static IConfigurationRoot BuildConfiguration()

203
templates/service/host/IdentityServerHost/IdentityServerDataSeedContributor.cs

@ -0,0 +1,203 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Configuration;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Guids;
using Volo.Abp.IdentityServer.ApiResources;
using Volo.Abp.IdentityServer.Clients;
using Volo.Abp.IdentityServer.IdentityResources;
using Volo.Abp.PermissionManagement;
using Volo.Abp.Uow;
namespace IdentityServerHost
{
public class IdentityServerDataSeedContributor : IDataSeedContributor, ITransientDependency
{
private readonly IApiResourceRepository _apiResourceRepository;
private readonly IClientRepository _clientRepository;
private readonly IIdentityResourceDataSeeder _identityResourceDataSeeder;
private readonly IGuidGenerator _guidGenerator;
private readonly IPermissionDataSeeder _permissionDataSeeder;
private readonly IConfigurationAccessor _configurationAccessor;
public IdentityServerDataSeedContributor(
IClientRepository clientRepository,
IApiResourceRepository apiResourceRepository,
IIdentityResourceDataSeeder identityResourceDataSeeder,
IGuidGenerator guidGenerator,
IPermissionDataSeeder permissionDataSeeder,
IConfigurationAccessor configurationAccessor)
{
_clientRepository = clientRepository;
_apiResourceRepository = apiResourceRepository;
_identityResourceDataSeeder = identityResourceDataSeeder;
_guidGenerator = guidGenerator;
_permissionDataSeeder = permissionDataSeeder;
_configurationAccessor = configurationAccessor;
}
[UnitOfWork]
public virtual async Task SeedAsync(DataSeedContext context)
{
await _identityResourceDataSeeder.CreateStandardResourcesAsync();
await CreateApiResourcesAsync();
await CreateClientsAsync();
}
private async Task CreateApiResourcesAsync()
{
var commonApiUserClaims = new[]
{
"email",
"email_verified",
"name",
"phone_number",
"phone_number_verified",
"role"
};
await CreateApiResourceAsync("MyProjectName", commonApiUserClaims);
}
private async Task<ApiResource> CreateApiResourceAsync(string name, IEnumerable<string> claims)
{
var apiResource = await _apiResourceRepository.FindByNameAsync(name);
if (apiResource == null)
{
apiResource = await _apiResourceRepository.InsertAsync(
new ApiResource(
_guidGenerator.Create(),
name,
name + " API"
),
autoSave: true
);
}
foreach (var claim in claims)
{
if (apiResource.FindClaim(claim) == null)
{
apiResource.AddUserClaim(claim);
}
}
return await _apiResourceRepository.UpdateAsync(apiResource);
}
private async Task CreateClientsAsync()
{
const string commonSecret = "E5Xd4yMqjP5kjWFKrYgySBju6JVfCzMyFp7n2QmMrME=";
var commonScopes = new[]
{
"email",
"openid",
"profile",
"role",
"phone",
"address",
"MyProjectName"
};
var configurationSection = _configurationAccessor.Configuration.GetSection("IdentityServer:Clients");
//Console Test Client
var consoleClientId = configurationSection["ConsoleClient:ClientId"];
if (!consoleClientId.IsNullOrWhiteSpace())
{
await CreateClientAsync(
consoleClientId,
commonScopes,
new[] { "password", "client_credentials" },
commonSecret
);
}
}
private async Task<Client> CreateClientAsync(
string name,
IEnumerable<string> scopes,
IEnumerable<string> grantTypes,
string secret,
string redirectUri = null,
string postLogoutRedirectUri = null,
IEnumerable<string> permissions = null)
{
var client = await _clientRepository.FindByCliendIdAsync(name);
if (client == null)
{
client = await _clientRepository.InsertAsync(
new Client(
_guidGenerator.Create(),
name
)
{
ClientName = name,
ProtocolType = "oidc",
Description = name,
AlwaysIncludeUserClaimsInIdToken = true,
AllowOfflineAccess = true,
AbsoluteRefreshTokenLifetime = 31536000, //365 days
AccessTokenLifetime = 31536000, //365 days
AuthorizationCodeLifetime = 300,
IdentityTokenLifetime = 300,
RequireConsent = false
},
autoSave: true
);
}
foreach (var scope in scopes)
{
if (client.FindScope(scope) == null)
{
client.AddScope(scope);
}
}
foreach (var grantType in grantTypes)
{
if (client.FindGrantType(grantType) == null)
{
client.AddGrantType(grantType);
}
}
if (client.FindSecret(secret) == null)
{
client.AddSecret(secret);
}
if (redirectUri != null)
{
if (client.FindRedirectUri(redirectUri) == null)
{
client.AddRedirectUri(redirectUri);
}
}
if (postLogoutRedirectUri != null)
{
if (client.FindPostLogoutRedirectUri(postLogoutRedirectUri) == null)
{
client.AddPostLogoutRedirectUri(postLogoutRedirectUri);
}
}
if (permissions != null)
{
await _permissionDataSeeder.SeedAsync(
ClientPermissionValueProvider.ProviderName,
name,
permissions
);
}
return await _clientRepository.UpdateAsync(client);
}
}
}

109
templates/service/host/IdentityServerHost/IdentityServerDataSeeder.cs

@ -1,109 +0,0 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.IdentityServer.ApiResources;
using Volo.Abp.IdentityServer.Clients;
using Volo.Abp.IdentityServer.IdentityResources;
using Volo.Abp.Threading;
namespace IdentityServerHost
{
public class IdentityServerDataSeeder : ITransientDependency
{
private readonly IApiResourceRepository _apiResourceRepository;
private readonly IClientRepository _clientRepository;
private readonly IIdentityResourceRepository _identityResourceRepository;
public IdentityServerDataSeeder(
IClientRepository clientRepository,
IApiResourceRepository apiResourceRepository,
IIdentityResourceRepository identityResourceRepository)
{
_clientRepository = clientRepository;
_apiResourceRepository = apiResourceRepository;
_identityResourceRepository = identityResourceRepository;
}
public void Seed()
{
AsyncHelper.RunSync(SeedAsync);
}
private async Task SeedAsync()
{
if (await _clientRepository.FindByCliendIdAsync("test-client") != null)
{
return;
}
await SaveApiResource();
await SaveClientAsync();
await SaveIdentityResourcesAsync();
}
private async Task SaveApiResource()
{
var apiResource = new ApiResource(
Guid.NewGuid(),
"api1",
"My API",
"My api resource description"
);
apiResource.AddUserClaim("email");
apiResource.AddUserClaim("role");
await _apiResourceRepository.InsertAsync(apiResource);
}
private async Task SaveClientAsync()
{
var client = new Client(
Guid.NewGuid(),
"test-client"
)
{
ClientName = "test-client",
ProtocolType = "oidc",
Description = "test-client",
AlwaysIncludeUserClaimsInIdToken = true,
AllowOfflineAccess = true,
AbsoluteRefreshTokenLifetime = 31536000 //365 days
};
client.AddScope("api1");
client.AddScope("email");
client.AddScope("openid");
client.AddScope("profile");
client.AddScope("roles");
client.AddScope("unique_name");
client.AddGrantType("client_credentials");
client.AddGrantType("password");
client.AddSecret("K7gNU3sdo+OL0wNhqoVWhr3g6s1xYv72ol/pe/Unols=");
await _clientRepository.InsertAsync(client);
}
private async Task SaveIdentityResourcesAsync()
{
var identityResourceOpenId = new IdentityResource(Guid.NewGuid(), "openid", "OpenID", required: true);
await _identityResourceRepository.InsertAsync(identityResourceOpenId);
var identityResourceEmail = new IdentityResource(Guid.NewGuid(), "email", "Email", required: true);
identityResourceEmail.AddUserClaim("email");
identityResourceEmail.AddUserClaim("email_verified");
await _identityResourceRepository.InsertAsync(identityResourceEmail);
var identityResourceRole = new IdentityResource(Guid.NewGuid(), "roles", "Roles", required: true);
identityResourceRole.AddUserClaim("role");
await _identityResourceRepository.InsertAsync(identityResourceRole);
var identityResourceProfile = new IdentityResource(Guid.NewGuid(), "profile", "Profile", required: true);
identityResourceProfile.AddUserClaim("unique_name");
await _identityResourceRepository.InsertAsync(identityResourceProfile);
}
}
}

14
templates/service/host/IdentityServerHost/IdentityServerHost.csproj

@ -8,10 +8,10 @@
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Serilog.AspNetCore" Version="2.1.1" />
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Redis" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="2.2.0" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc\Volo.Abp.AspNetCore.Mvc.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.MultiTenancy\Volo.Abp.AspNetCore.MultiTenancy.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.EntityFrameworkCore.SqlServer\Volo.Abp.EntityFrameworkCore.SqlServer.csproj" />
<ProjectReference Include="..\..\..\..\modules\identityserver\src\Volo.Abp.IdentityServer.EntityFrameworkCore\Volo.Abp.IdentityServer.EntityFrameworkCore.csproj" />
@ -29,4 +29,12 @@
<None Remove="Logs\**" />
</ItemGroup>
<Target Name="ChangeAliasesOfStrongNameAssemblies" BeforeTargets="FindReferenceAssembliesForReferences;ResolveReferences">
<ItemGroup>
<ReferencePath Condition="'%(FileName)' == 'StackExchange.Redis.StrongName'">
<Aliases>signed</Aliases>
</ReferencePath>
</ItemGroup>
</Target>
</Project>

70
templates/service/host/IdentityServerHost/IdentityServerHostModule.cs

@ -1,8 +1,13 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using IdentityServerHost.MultiTenancy;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.DataProtection;
using StackExchange.Redis;
using Volo.Abp;
using Volo.Abp.AspNetCore.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.Autofac;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
@ -10,17 +15,25 @@ using Volo.Abp.EntityFrameworkCore.SqlServer;
using Volo.Abp.Identity.AspNetCore;
using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.IdentityServer.EntityFrameworkCore;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.SettingManagement.EntityFrameworkCore;
using Volo.Abp.Threading;
namespace IdentityServerHost
{
[DependsOn(
typeof(AbpAutofacModule),
typeof(AbpAspNetCoreMultiTenancyModule),
typeof(AbpAspNetCoreMvcModule),
typeof(AbpAuditLoggingEntityFrameworkCoreModule),
typeof(AbpAutofacModule),
typeof(AbpEntityFrameworkCoreSqlServerModule),
typeof(AbpIdentityAspNetCoreModule),
typeof(AbpIdentityServerEntityFrameworkCoreModule),
typeof(AbpIdentityEntityFrameworkCoreModule),
typeof(AbpEntityFrameworkCoreSqlServerModule)
typeof(AbpIdentityServerEntityFrameworkCoreModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule)
)]
public class IdentityServerHostModule : AbpModule
{
@ -29,28 +42,29 @@ namespace IdentityServerHost
var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.BuildConfiguration();
Configure<DbConnectionOptions>(options =>
{
options.ConnectionStrings.Default = configuration.GetConnectionString("Default");
});
Configure<AbpDbContextOptions>(options =>
{
options.UseSqlServer();
});
Configure<IISOptions>(iis =>
Configure<AbpLocalizationOptions>(options =>
{
iis.AuthenticationDisplayName = "Windows";
iis.AutomaticAuthentication = false;
options.Languages.Add(new LanguageInfo("en", "en", "English"));
//...you can add other languages
});
context.Services.AddDistributedSqlServerCache(options =>
context.Services.AddDistributedRedisCache(options =>
{
options.ConnectionString = configuration.GetConnectionString("SqlServerCache");
options.SchemaName = "dbo";
options.TableName = "TestCache";
options.Configuration = configuration["Redis:Configuration"];
});
if (!hostingEnvironment.IsDevelopment())
{
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
context.Services
.AddDataProtection()
.PersistKeysToStackExchangeRedis(redis, "MyProjectName-Protection-Keys");
}
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
@ -58,11 +72,14 @@ namespace IdentityServerHost
var app = context.GetApplicationBuilder();
app.UseVirtualFiles();
app.UseAuthentication();
if (MultiTenancyConsts.IsEnabled)
{
app.UseMultiTenancy();
}
app.UseIdentityServer();
app.UseAbpRequestLocalization();
app.UseAuditing();
app.UseMvcWithDefaultRoute();
SeedData(context);
@ -70,12 +87,15 @@ namespace IdentityServerHost
private void SeedData(ApplicationInitializationContext context)
{
using (var scope = context.ServiceProvider.CreateScope())
AsyncHelper.RunSync(async () =>
{
scope.ServiceProvider
.GetRequiredService<IdentityServerDataSeeder>()
.Seed();
}
using (var scope = context.ServiceProvider.CreateScope())
{
await scope.ServiceProvider
.GetRequiredService<IDataSeeder>()
.SeedAsync();
}
});
}
}
}

1227
templates/service/host/IdentityServerHost/Migrations/20190410095119_Initial.Designer.cs

File diff suppressed because it is too large

921
templates/service/host/IdentityServerHost/Migrations/20190410095119_Initial.cs

@ -1,921 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace IdentityServerHost.Migrations
{
public partial class Initial : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AbpAuditLogs",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
ApplicationName = table.Column<string>(maxLength: 96, nullable: true),
UserId = table.Column<Guid>(nullable: true),
UserName = table.Column<string>(maxLength: 256, nullable: true),
TenantId = table.Column<Guid>(nullable: true),
TenantName = table.Column<string>(nullable: true),
ImpersonatorUserId = table.Column<Guid>(nullable: true),
ImpersonatorTenantId = table.Column<Guid>(nullable: true),
ExecutionTime = table.Column<DateTime>(nullable: false),
ExecutionDuration = table.Column<int>(nullable: false),
ClientIpAddress = table.Column<string>(maxLength: 64, nullable: true),
ClientName = table.Column<string>(maxLength: 128, nullable: true),
ClientId = table.Column<string>(maxLength: 64, nullable: true),
CorrelationId = table.Column<string>(maxLength: 64, nullable: true),
BrowserInfo = table.Column<string>(maxLength: 512, nullable: true),
HttpMethod = table.Column<string>(maxLength: 16, nullable: true),
Url = table.Column<string>(maxLength: 256, nullable: true),
Exceptions = table.Column<string>(maxLength: 4000, nullable: true),
Comments = table.Column<string>(maxLength: 256, nullable: true),
HttpStatusCode = table.Column<int>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpAuditLogs", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpClaimTypes",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(maxLength: 256, nullable: false),
Name = table.Column<string>(maxLength: 256, nullable: false),
Required = table.Column<bool>(nullable: false),
IsStatic = table.Column<bool>(nullable: false),
Regex = table.Column<string>(maxLength: 512, nullable: true),
RegexDescription = table.Column<string>(maxLength: 128, nullable: true),
Description = table.Column<string>(maxLength: 256, nullable: true),
ValueType = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpClaimTypes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpPermissionGrants",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
Name = table.Column<string>(maxLength: 128, nullable: false),
ProviderName = table.Column<string>(maxLength: 64, nullable: false),
ProviderKey = table.Column<string>(maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpRoles",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(maxLength: 256, nullable: false),
TenantId = table.Column<Guid>(nullable: true),
Name = table.Column<string>(maxLength: 256, nullable: false),
NormalizedName = table.Column<string>(maxLength: 256, nullable: false),
IsDefault = table.Column<bool>(nullable: false),
IsStatic = table.Column<bool>(nullable: false),
IsPublic = table.Column<bool>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpRoles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpSettings",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
Name = table.Column<string>(maxLength: 128, nullable: false),
Value = table.Column<string>(maxLength: 2048, nullable: false),
ProviderName = table.Column<string>(maxLength: 64, nullable: true),
ProviderKey = table.Column<string>(maxLength: 64, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpSettings", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpUsers",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
UserName = table.Column<string>(maxLength: 256, nullable: false),
NormalizedUserName = table.Column<string>(maxLength: 256, nullable: false),
Name = table.Column<string>(maxLength: 64, nullable: true),
Surname = table.Column<string>(maxLength: 64, nullable: true),
Email = table.Column<string>(maxLength: 256, nullable: true),
NormalizedEmail = table.Column<string>(maxLength: 256, nullable: true),
EmailConfirmed = table.Column<bool>(nullable: false, defaultValue: false),
PasswordHash = table.Column<string>(maxLength: 256, nullable: true),
SecurityStamp = table.Column<string>(maxLength: 256, nullable: false),
PhoneNumber = table.Column<string>(maxLength: 16, nullable: true),
PhoneNumberConfirmed = table.Column<bool>(nullable: false, defaultValue: false),
TwoFactorEnabled = table.Column<bool>(nullable: false, defaultValue: false),
LockoutEnd = table.Column<DateTimeOffset>(nullable: true),
LockoutEnabled = table.Column<bool>(nullable: false, defaultValue: false),
AccessFailedCount = table.Column<int>(nullable: false, defaultValue: 0)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUsers", x => x.Id);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiResources",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
Name = table.Column<string>(maxLength: 200, nullable: false),
DisplayName = table.Column<string>(maxLength: 200, nullable: true),
Description = table.Column<string>(maxLength: 1000, nullable: true),
Enabled = table.Column<bool>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiResources", x => x.Id);
});
migrationBuilder.CreateTable(
name: "IdentityServerClients",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
ClientId = table.Column<string>(maxLength: 200, nullable: false),
ClientName = table.Column<string>(maxLength: 200, nullable: true),
Description = table.Column<string>(maxLength: 1000, nullable: true),
ClientUri = table.Column<string>(maxLength: 300, nullable: true),
LogoUri = table.Column<string>(maxLength: 300, nullable: true),
Enabled = table.Column<bool>(nullable: false),
ProtocolType = table.Column<string>(maxLength: 200, nullable: false),
RequireClientSecret = table.Column<bool>(nullable: false),
RequireConsent = table.Column<bool>(nullable: false),
AllowRememberConsent = table.Column<bool>(nullable: false),
AlwaysIncludeUserClaimsInIdToken = table.Column<bool>(nullable: false),
RequirePkce = table.Column<bool>(nullable: false),
AllowPlainTextPkce = table.Column<bool>(nullable: false),
AllowAccessTokensViaBrowser = table.Column<bool>(nullable: false),
FrontChannelLogoutUri = table.Column<string>(maxLength: 300, nullable: true),
FrontChannelLogoutSessionRequired = table.Column<bool>(nullable: false),
BackChannelLogoutUri = table.Column<string>(maxLength: 300, nullable: true),
BackChannelLogoutSessionRequired = table.Column<bool>(nullable: false),
AllowOfflineAccess = table.Column<bool>(nullable: false),
IdentityTokenLifetime = table.Column<int>(nullable: false),
AccessTokenLifetime = table.Column<int>(nullable: false),
AuthorizationCodeLifetime = table.Column<int>(nullable: false),
ConsentLifetime = table.Column<int>(nullable: true),
AbsoluteRefreshTokenLifetime = table.Column<int>(nullable: false),
SlidingRefreshTokenLifetime = table.Column<int>(nullable: false),
RefreshTokenUsage = table.Column<int>(nullable: false),
UpdateAccessTokenClaimsOnRefresh = table.Column<bool>(nullable: false),
RefreshTokenExpiration = table.Column<int>(nullable: false),
AccessTokenType = table.Column<int>(nullable: false),
EnableLocalLogin = table.Column<bool>(nullable: false),
IncludeJwtId = table.Column<bool>(nullable: false),
AlwaysSendClientClaims = table.Column<bool>(nullable: false),
ClientClaimsPrefix = table.Column<string>(maxLength: 200, nullable: true),
PairWiseSubjectSalt = table.Column<string>(maxLength: 200, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClients", x => x.Id);
});
migrationBuilder.CreateTable(
name: "IdentityServerIdentityResources",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
Name = table.Column<string>(maxLength: 200, nullable: false),
DisplayName = table.Column<string>(maxLength: 200, nullable: true),
Description = table.Column<string>(maxLength: 1000, nullable: true),
Enabled = table.Column<bool>(nullable: false),
Required = table.Column<bool>(nullable: false),
Emphasize = table.Column<bool>(nullable: false),
ShowInDiscoveryDocument = table.Column<bool>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerIdentityResources", x => x.Id);
});
migrationBuilder.CreateTable(
name: "IdentityServerPersistedGrants",
columns: table => new
{
Key = table.Column<string>(maxLength: 200, nullable: false),
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
Type = table.Column<string>(maxLength: 50, nullable: false),
SubjectId = table.Column<string>(maxLength: 200, nullable: true),
ClientId = table.Column<string>(maxLength: 200, nullable: false),
CreationTime = table.Column<DateTime>(nullable: false),
Expiration = table.Column<DateTime>(nullable: true),
Data = table.Column<string>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerPersistedGrants", x => x.Key);
});
migrationBuilder.CreateTable(
name: "AbpAuditLogActions",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
AuditLogId = table.Column<Guid>(nullable: false),
ServiceName = table.Column<string>(maxLength: 256, nullable: true),
MethodName = table.Column<string>(maxLength: 128, nullable: true),
Parameters = table.Column<string>(maxLength: 2000, nullable: true),
ExecutionTime = table.Column<DateTime>(nullable: false),
ExecutionDuration = table.Column<int>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpAuditLogActions", x => x.Id);
table.ForeignKey(
name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId",
column: x => x.AuditLogId,
principalTable: "AbpAuditLogs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpEntityChanges",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
AuditLogId = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
ChangeTime = table.Column<DateTime>(nullable: false),
ChangeType = table.Column<byte>(nullable: false),
EntityTenantId = table.Column<Guid>(nullable: true),
EntityId = table.Column<string>(maxLength: 128, nullable: false),
EntityTypeFullName = table.Column<string>(maxLength: 128, nullable: false),
ExtraProperties = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpEntityChanges", x => x.Id);
table.ForeignKey(
name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId",
column: x => x.AuditLogId,
principalTable: "AbpAuditLogs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpRoleClaims",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
ClaimType = table.Column<string>(maxLength: 256, nullable: false),
ClaimValue = table.Column<string>(maxLength: 1024, nullable: true),
RoleId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpRoleClaims", x => x.Id);
table.ForeignKey(
name: "FK_AbpRoleClaims_AbpRoles_RoleId",
column: x => x.RoleId,
principalTable: "AbpRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpUserClaims",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
ClaimType = table.Column<string>(maxLength: 256, nullable: false),
ClaimValue = table.Column<string>(maxLength: 1024, nullable: true),
UserId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUserClaims", x => x.Id);
table.ForeignKey(
name: "FK_AbpUserClaims_AbpUsers_UserId",
column: x => x.UserId,
principalTable: "AbpUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpUserLogins",
columns: table => new
{
UserId = table.Column<Guid>(nullable: false),
LoginProvider = table.Column<string>(maxLength: 64, nullable: false),
TenantId = table.Column<Guid>(nullable: true),
ProviderKey = table.Column<string>(maxLength: 196, nullable: false),
ProviderDisplayName = table.Column<string>(maxLength: 128, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUserLogins", x => new { x.UserId, x.LoginProvider });
table.ForeignKey(
name: "FK_AbpUserLogins_AbpUsers_UserId",
column: x => x.UserId,
principalTable: "AbpUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpUserRoles",
columns: table => new
{
UserId = table.Column<Guid>(nullable: false),
RoleId = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUserRoles", x => new { x.UserId, x.RoleId });
table.ForeignKey(
name: "FK_AbpUserRoles_AbpRoles_RoleId",
column: x => x.RoleId,
principalTable: "AbpRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AbpUserRoles_AbpUsers_UserId",
column: x => x.UserId,
principalTable: "AbpUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpUserTokens",
columns: table => new
{
UserId = table.Column<Guid>(nullable: false),
LoginProvider = table.Column<string>(maxLength: 64, nullable: false),
Name = table.Column<string>(maxLength: 128, nullable: false),
TenantId = table.Column<Guid>(nullable: true),
Value = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
table.ForeignKey(
name: "FK_AbpUserTokens_AbpUsers_UserId",
column: x => x.UserId,
principalTable: "AbpUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiClaims",
columns: table => new
{
Type = table.Column<string>(maxLength: 196, nullable: false),
ApiResourceId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiClaims", x => new { x.ApiResourceId, x.Type });
table.ForeignKey(
name: "FK_IdentityServerApiClaims_IdentityServerApiResources_ApiResourceId",
column: x => x.ApiResourceId,
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiScopes",
columns: table => new
{
ApiResourceId = table.Column<Guid>(nullable: false),
Name = table.Column<string>(maxLength: 196, nullable: false),
DisplayName = table.Column<string>(maxLength: 128, nullable: true),
Description = table.Column<string>(maxLength: 256, nullable: true),
Required = table.Column<bool>(nullable: false),
Emphasize = table.Column<bool>(nullable: false),
ShowInDiscoveryDocument = table.Column<bool>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiScopes", x => new { x.ApiResourceId, x.Name });
table.ForeignKey(
name: "FK_IdentityServerApiScopes_IdentityServerApiResources_ApiResourceId",
column: x => x.ApiResourceId,
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiSecrets",
columns: table => new
{
Type = table.Column<string>(maxLength: 32, nullable: false),
Value = table.Column<string>(maxLength: 196, nullable: false),
ApiResourceId = table.Column<Guid>(nullable: false),
Description = table.Column<string>(maxLength: 256, nullable: true),
Expiration = table.Column<DateTime>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiSecrets", x => new { x.ApiResourceId, x.Type, x.Value });
table.ForeignKey(
name: "FK_IdentityServerApiSecrets_IdentityServerApiResources_ApiResourceId",
column: x => x.ApiResourceId,
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientClaims",
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
Type = table.Column<string>(maxLength: 250, nullable: false),
Value = table.Column<string>(maxLength: 250, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientClaims", x => new { x.ClientId, x.Type, x.Value });
table.ForeignKey(
name: "FK_IdentityServerClientClaims_IdentityServerClients_ClientId",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientCorsOrigins",
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
Origin = table.Column<string>(maxLength: 150, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientCorsOrigins", x => new { x.ClientId, x.Origin });
table.ForeignKey(
name: "FK_IdentityServerClientCorsOrigins_IdentityServerClients_ClientId",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientGrantTypes",
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
GrantType = table.Column<string>(maxLength: 196, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientGrantTypes", x => new { x.ClientId, x.GrantType });
table.ForeignKey(
name: "FK_IdentityServerClientGrantTypes_IdentityServerClients_ClientId",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientIdPRestrictions",
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
Provider = table.Column<string>(maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientIdPRestrictions", x => new { x.ClientId, x.Provider });
table.ForeignKey(
name: "FK_IdentityServerClientIdPRestrictions_IdentityServerClients_ClientId",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientPostLogoutRedirectUris",
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
PostLogoutRedirectUri = table.Column<string>(maxLength: 200, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientPostLogoutRedirectUris", x => new { x.ClientId, x.PostLogoutRedirectUri });
table.ForeignKey(
name: "FK_IdentityServerClientPostLogoutRedirectUris_IdentityServerClients_ClientId",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientProperties",
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
Key = table.Column<string>(maxLength: 64, nullable: false),
Value = table.Column<string>(maxLength: 128, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientProperties", x => new { x.ClientId, x.Key });
table.ForeignKey(
name: "FK_IdentityServerClientProperties_IdentityServerClients_ClientId",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientRedirectUris",
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
RedirectUri = table.Column<string>(maxLength: 200, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientRedirectUris", x => new { x.ClientId, x.RedirectUri });
table.ForeignKey(
name: "FK_IdentityServerClientRedirectUris_IdentityServerClients_ClientId",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientScopes",
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
Scope = table.Column<string>(maxLength: 196, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientScopes", x => new { x.ClientId, x.Scope });
table.ForeignKey(
name: "FK_IdentityServerClientScopes_IdentityServerClients_ClientId",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientSecrets",
columns: table => new
{
Type = table.Column<string>(maxLength: 32, nullable: false),
Value = table.Column<string>(maxLength: 196, nullable: false),
ClientId = table.Column<Guid>(nullable: false),
Description = table.Column<string>(maxLength: 256, nullable: true),
Expiration = table.Column<DateTime>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientSecrets", x => new { x.ClientId, x.Type, x.Value });
table.ForeignKey(
name: "FK_IdentityServerClientSecrets_IdentityServerClients_ClientId",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerIdentityClaims",
columns: table => new
{
Type = table.Column<string>(maxLength: 196, nullable: false),
IdentityResourceId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerIdentityClaims", x => new { x.IdentityResourceId, x.Type });
table.ForeignKey(
name: "FK_IdentityServerIdentityClaims_IdentityServerIdentityResources_IdentityResourceId",
column: x => x.IdentityResourceId,
principalTable: "IdentityServerIdentityResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpEntityPropertyChanges",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
EntityChangeId = table.Column<Guid>(nullable: false),
NewValue = table.Column<string>(maxLength: 512, nullable: true),
OriginalValue = table.Column<string>(maxLength: 512, nullable: true),
PropertyName = table.Column<string>(maxLength: 128, nullable: false),
PropertyTypeFullName = table.Column<string>(maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpEntityPropertyChanges", x => x.Id);
table.ForeignKey(
name: "FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId",
column: x => x.EntityChangeId,
principalTable: "AbpEntityChanges",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiScopeClaims",
columns: table => new
{
Type = table.Column<string>(maxLength: 196, nullable: false),
ApiResourceId = table.Column<Guid>(nullable: false),
Name = table.Column<string>(maxLength: 196, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiScopeClaims", x => new { x.ApiResourceId, x.Name, x.Type });
table.ForeignKey(
name: "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiResourceId_Name",
columns: x => new { x.ApiResourceId, x.Name },
principalTable: "IdentityServerApiScopes",
principalColumns: new[] { "ApiResourceId", "Name" },
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogActions_AuditLogId",
table: "AbpAuditLogActions",
column: "AuditLogId");
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_ExecutionTime",
table: "AbpAuditLogActions",
columns: new[] { "TenantId", "ServiceName", "MethodName", "ExecutionTime" });
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogs_TenantId_ExecutionTime",
table: "AbpAuditLogs",
columns: new[] { "TenantId", "ExecutionTime" });
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogs_TenantId_UserId_ExecutionTime",
table: "AbpAuditLogs",
columns: new[] { "TenantId", "UserId", "ExecutionTime" });
migrationBuilder.CreateIndex(
name: "IX_AbpEntityChanges_AuditLogId",
table: "AbpEntityChanges",
column: "AuditLogId");
migrationBuilder.CreateIndex(
name: "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId",
table: "AbpEntityChanges",
columns: new[] { "TenantId", "EntityTypeFullName", "EntityId" });
migrationBuilder.CreateIndex(
name: "IX_AbpEntityPropertyChanges_EntityChangeId",
table: "AbpEntityPropertyChanges",
column: "EntityChangeId");
migrationBuilder.CreateIndex(
name: "IX_AbpPermissionGrants_Name_ProviderName_ProviderKey",
table: "AbpPermissionGrants",
columns: new[] { "Name", "ProviderName", "ProviderKey" });
migrationBuilder.CreateIndex(
name: "IX_AbpRoleClaims_RoleId",
table: "AbpRoleClaims",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "IX_AbpRoles_NormalizedName",
table: "AbpRoles",
column: "NormalizedName");
migrationBuilder.CreateIndex(
name: "IX_AbpSettings_Name_ProviderName_ProviderKey",
table: "AbpSettings",
columns: new[] { "Name", "ProviderName", "ProviderKey" });
migrationBuilder.CreateIndex(
name: "IX_AbpUserClaims_UserId",
table: "AbpUserClaims",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_AbpUserLogins_LoginProvider_ProviderKey",
table: "AbpUserLogins",
columns: new[] { "LoginProvider", "ProviderKey" });
migrationBuilder.CreateIndex(
name: "IX_AbpUserRoles_RoleId_UserId",
table: "AbpUserRoles",
columns: new[] { "RoleId", "UserId" });
migrationBuilder.CreateIndex(
name: "IX_AbpUsers_Email",
table: "AbpUsers",
column: "Email");
migrationBuilder.CreateIndex(
name: "IX_AbpUsers_NormalizedEmail",
table: "AbpUsers",
column: "NormalizedEmail");
migrationBuilder.CreateIndex(
name: "IX_AbpUsers_NormalizedUserName",
table: "AbpUsers",
column: "NormalizedUserName");
migrationBuilder.CreateIndex(
name: "IX_AbpUsers_UserName",
table: "AbpUsers",
column: "UserName");
migrationBuilder.CreateIndex(
name: "IX_IdentityServerClients_ClientId",
table: "IdentityServerClients",
column: "ClientId",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_IdentityServerPersistedGrants_SubjectId_ClientId_Type",
table: "IdentityServerPersistedGrants",
columns: new[] { "SubjectId", "ClientId", "Type" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AbpAuditLogActions");
migrationBuilder.DropTable(
name: "AbpClaimTypes");
migrationBuilder.DropTable(
name: "AbpEntityPropertyChanges");
migrationBuilder.DropTable(
name: "AbpPermissionGrants");
migrationBuilder.DropTable(
name: "AbpRoleClaims");
migrationBuilder.DropTable(
name: "AbpSettings");
migrationBuilder.DropTable(
name: "AbpUserClaims");
migrationBuilder.DropTable(
name: "AbpUserLogins");
migrationBuilder.DropTable(
name: "AbpUserRoles");
migrationBuilder.DropTable(
name: "AbpUserTokens");
migrationBuilder.DropTable(
name: "IdentityServerApiClaims");
migrationBuilder.DropTable(
name: "IdentityServerApiScopeClaims");
migrationBuilder.DropTable(
name: "IdentityServerApiSecrets");
migrationBuilder.DropTable(
name: "IdentityServerClientClaims");
migrationBuilder.DropTable(
name: "IdentityServerClientCorsOrigins");
migrationBuilder.DropTable(
name: "IdentityServerClientGrantTypes");
migrationBuilder.DropTable(
name: "IdentityServerClientIdPRestrictions");
migrationBuilder.DropTable(
name: "IdentityServerClientPostLogoutRedirectUris");
migrationBuilder.DropTable(
name: "IdentityServerClientProperties");
migrationBuilder.DropTable(
name: "IdentityServerClientRedirectUris");
migrationBuilder.DropTable(
name: "IdentityServerClientScopes");
migrationBuilder.DropTable(
name: "IdentityServerClientSecrets");
migrationBuilder.DropTable(
name: "IdentityServerIdentityClaims");
migrationBuilder.DropTable(
name: "IdentityServerPersistedGrants");
migrationBuilder.DropTable(
name: "AbpEntityChanges");
migrationBuilder.DropTable(
name: "AbpRoles");
migrationBuilder.DropTable(
name: "AbpUsers");
migrationBuilder.DropTable(
name: "IdentityServerApiScopes");
migrationBuilder.DropTable(
name: "IdentityServerClients");
migrationBuilder.DropTable(
name: "IdentityServerIdentityResources");
migrationBuilder.DropTable(
name: "AbpAuditLogs");
migrationBuilder.DropTable(
name: "IdentityServerApiResources");
}
}
}

1225
templates/service/host/IdentityServerHost/Migrations/DemoAppDbContextModelSnapshot.cs

File diff suppressed because it is too large

9
templates/service/host/IdentityServerHost/MultiTenancy/MultiTenancyConsts.cs

@ -0,0 +1,9 @@
namespace IdentityServerHost.MultiTenancy
{
public static class MultiTenancyConsts
{
/* Enable/disable multi-tenancy.
*/
public const bool IsEnabled = false;
}
}

4
templates/service/host/IdentityServerHost/Program.cs

@ -11,7 +11,11 @@ namespace IdentityServerHost
public static int Main(string[] args)
{
Log.Logger = new LoggerConfiguration()
#if DEBUG
.MinimumLevel.Debug()
#else
.MinimumLevel.Information()
#endif
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
.WriteTo.File("Logs/logs.txt")

14
templates/service/host/IdentityServerHost/appsettings.json

@ -1,7 +1,15 @@
{
"ConnectionStrings": {
"Default": "Server=localhost;Database=MyProjectName_Identity;Trusted_Connection=True;MultipleActiveResultSets=true",
"SqlServerCache": "Server=localhost;Database=MyProjectName_Cache;Trusted_Connection=True;MultipleActiveResultSets=true"
"Default": "Server=localhost;Database=MyProjectName_Identity;Trusted_Connection=True;MultipleActiveResultSets=true"
},
"Redis": {
"Configuration": "127.0.0.1"
},
"IdentityServer": {
"Clients": {
"ConsoleClient": {
"ClientId": "ConsoleClient"
}
}
}
}

29
templates/service/host/MyCompanyName.MyProjectName.Host/DemoAppDbContext.cs

@ -1,29 +0,0 @@
using Microsoft.EntityFrameworkCore;
using MyCompanyName.MyProjectName.EntityFrameworkCore;
using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.SettingManagement.EntityFrameworkCore;
namespace MyCompanyName.MyProjectName.Host
{
public class DemoAppDbContext : AbpDbContext<DemoAppDbContext>
{
public DemoAppDbContext(DbContextOptions<DemoAppDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.ConfigurePermissionManagement();
modelBuilder.ConfigureSettingManagement();
modelBuilder.ConfigureAuditLogging();
modelBuilder.ConfigureMyProjectName();
}
}
}

343
templates/service/host/MyCompanyName.MyProjectName.Host/Logs/logs.txt

@ -1,343 +0,0 @@
2018-10-30 18:17:33.924 +03:00 [INF] Starting web host.
2018-10-30 18:17:36.652 +03:00 [INF] User profile is available. Using 'C:\Users\halil\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
2018-10-30 18:17:36.720 +03:00 [INF] Loaded modules:
2018-10-30 18:17:36.720 +03:00 [INF] - Volo.Abp.Castle.AbpCastleCoreModule
2018-10-30 18:17:36.720 +03:00 [INF] - Volo.Abp.Autofac.AbpAutofacModule
2018-10-30 18:17:36.720 +03:00 [INF] - Volo.Abp.VirtualFileSystem.AbpVirtualFileSystemModule
2018-10-30 18:17:36.720 +03:00 [INF] - Volo.Abp.Settings.AbpSettingsModule
2018-10-30 18:17:36.720 +03:00 [INF] - Volo.Abp.Localization.AbpLocalizationModule
2018-10-30 18:17:36.720 +03:00 [INF] - MyCompanyName.MyProjectName.MyProjectNameDomainSharedModule
2018-10-30 18:17:36.721 +03:00 [INF] - MyCompanyName.MyProjectName.MyProjectNameDomainModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.Data.AbpDataModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.Timing.AbpTimingModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.Json.AbpJsonModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.Security.AbpSecurityModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.Threading.AbpThreadingModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.MultiTenancy.AbpMultiTenancyAbstractionsModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.Auditing.AbpAuditingModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.EventBus.AbpEventBusModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.Guids.AbpGuidsModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.Uow.AbpUnitOfWorkModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.Domain.AbpDddDomainModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.ObjectMapping.AbpObjectMappingModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.Validation.AbpValidationModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.Authorization.AbpAuthorizationModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.Http.AbpHttpAbstractionsModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.Application.AbpDddApplicationModule
2018-10-30 18:17:36.721 +03:00 [INF] - MyCompanyName.MyProjectName.MyProjectNameApplicationContractsModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.AutoMapper.AbpAutoMapperModule
2018-10-30 18:17:36.721 +03:00 [INF] - MyCompanyName.MyProjectName.MyProjectNameApplicationModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.EntityFrameworkCore.AbpEntityFrameworkCoreModule
2018-10-30 18:17:36.721 +03:00 [INF] - MyCompanyName.MyProjectName.EntityFrameworkCore.MyProjectNameEntityFrameworkCoreModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.Http.AbpHttpModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.UI.AbpUiModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.AspNetCore.AbpAspNetCoreModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.ApiVersioning.AbpApiVersioningAbstractionsModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.AspNetCore.Mvc.AbpAspNetCoreMvcModule
2018-10-30 18:17:36.721 +03:00 [INF] - MyCompanyName.MyProjectName.MyProjectNameHttpApiModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.PermissionManagement.AbpPermissionManagementDomainSharedModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.Serialization.AbpSerializationModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.Caching.AbpCachingModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.PermissionManagement.AbpPermissionManagementDomainModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.PermissionManagement.EntityFrameworkCore.AbpPermissionManagementEntityFrameworkCoreModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.SettingManagement.AbpSettingManagementDomainSharedModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.SettingManagement.AbpSettingManagementDomainModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.SettingManagement.EntityFrameworkCore.AbpSettingManagementEntityFrameworkCoreModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.AuditLogging.AbpAuditLoggingDomainSharedModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.AuditLogging.AbpAuditLoggingDomainModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.AuditLogging.EntityFrameworkCore.AbpAuditLoggingEntityFrameworkCoreModule
2018-10-30 18:17:36.721 +03:00 [INF] - Volo.Abp.EntityFrameworkCore.SqlServer.AbpEntityFrameworkCoreSqlServerModule
2018-10-30 18:17:36.721 +03:00 [INF] - MyCompanyName.MyProjectName.Host.DemoAppModule
2018-10-30 18:17:36.774 +03:00 [DBG] No class found with auto mapping attributes.
2018-10-30 18:17:37.557 +03:00 [DBG] BEGIN SaveChangesAsync:True
2018-10-30 18:17:37.592 +03:00 [DBG] at System.Environment.get_StackTrace()
at Volo.Abp.EntityFrameworkCore.AbpDbContext`1.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) in D:\Github\abp\framework\src\Volo.Abp.EntityFrameworkCore\Volo\Abp\EntityFrameworkCore\AbpDbContext.cs:line 132
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Volo.Abp.EntityFrameworkCore.AbpDbContext`1.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(CancellationToken cancellationToken)
at Volo.Abp.Uow.EntityFrameworkCore.EfCoreDatabaseApi`1.SaveChangesAsync(CancellationToken cancellationToken) in D:\Github\abp\framework\src\Volo.Abp.EntityFrameworkCore\Volo\Abp\Uow\EntityFrameworkCore\EfCoreDatabaseApi.cs:line 19
at Volo.Abp.Uow.UnitOfWork.SaveChangesAsync(CancellationToken cancellationToken) in D:\Github\abp\framework\src\Volo.Abp.Uow\Volo\Abp\Uow\UnitOfWork.cs:line 88
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Volo.Abp.Uow.UnitOfWork.SaveChangesAsync(CancellationToken cancellationToken)
at Volo.Abp.Uow.UnitOfWork.CompleteAsync(CancellationToken cancellationToken) in D:\Github\abp\framework\src\Volo.Abp.Uow\Volo\Abp\Uow\UnitOfWork.cs:line 126
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Volo.Abp.Uow.UnitOfWork.CompleteAsync(CancellationToken cancellationToken)
at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) in D:\Github\abp\framework\src\Volo.Abp.Uow\Volo\Abp\Uow\UnitOfWorkInterceptor.cs:line 47
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext()
at System.Threading.Tasks.AwaitTaskContinuation.RunCallback(ContextCallback callback, Object state, Task& currentTask)
at System.Threading.Tasks.Task.RunContinuations(Object continuationObject)
at System.Threading.Tasks.Task`1.TrySetResult(TResult result)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetExistingTaskResult(TResult result)
at Volo.Abp.SettingManagement.EntityFrameworkCore.EfCoreSettingRepository.FindAsync(String name, String providerName, String providerKey) in D:\Github\abp\modules\setting-management\src\Volo.Abp.SettingManagement.EntityFrameworkCore\Volo\Abp\SettingManagement\EntityFrameworkCore\EfCoreSettingRepository.cs:line 24
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext()
at System.Threading.Tasks.AwaitTaskContinuation.RunCallback(ContextCallback callback, Object state, Task& currentTask)
at System.Threading.Tasks.Task.RunContinuations(Object continuationObject)
at System.Threading.Tasks.Task`1.TrySetResult(TResult result)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetExistingTaskResult(TResult result)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.ExecuteSingletonAsyncQuery[TResult](QueryContext queryContext, Func`2 compiledQuery, IDiagnosticsLogger`1 logger, Type contextType)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext()
at System.Threading.Tasks.AwaitTaskContinuation.RunCallback(ContextCallback callback, Object state, Task& currentTask)
at System.Threading.Tasks.Task.RunContinuations(Object continuationObject)
at System.Threading.Tasks.Task`1.TrySetResult(TResult result)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetExistingTaskResult(TResult result)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetResult(TResult result)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.MoveNext(CancellationToken cancellationToken)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
at System.Threading.Tasks.Task.ExecuteEntry()
at Nito.AsyncEx.AsyncContext.Execute()
at Nito.AsyncEx.AsyncContext.Run[TResult](Func`1 action)
at Volo.Abp.Threading.AsyncHelper.RunSync[TResult](Func`1 func) in D:\Github\abp\framework\src\Volo.Abp.Core\Volo\Abp\Threading\AsyncHelper.cs:line 60
at Volo.Abp.Settings.SettingManagerSyncExtensions.GetOrNull(ISettingManager settingManager, String name) in D:\Github\abp\framework\src\Volo.Abp.Settings\Volo\Abp\Settings\SettingManagerSyncExtensions.cs:line 13
at Microsoft.AspNetCore.Builder.AbpApplicationBuilderExtensions.UseAbpRequestLocalization(IApplicationBuilder app) in D:\Github\abp\framework\src\Volo.Abp.AspNetCore\Microsoft\AspNetCore\Builder\AbpApplicationBuilderExtensions.cs:line 54
at MyCompanyName.MyProjectName.Host.DemoAppModule.OnApplicationInitialization(ApplicationInitializationContext context) in D:\Github\abp\templates\service\host\MyCompanyName.MyProjectName.Host\DemoAppModule.cs:line 87
at Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributer.Initialize(ApplicationInitializationContext context, IAbpModule module) in D:\Github\abp\framework\src\Volo.Abp.Core\Volo\Abp\Modularity\DefaultModuleLifecycleContributer.cs:line 7
at Volo.Abp.Modularity.ModuleManager.InitializeModules(ApplicationInitializationContext context) in D:\Github\abp\framework\src\Volo.Abp.Core\Volo\Abp\Modularity\ModuleManager.cs:line 41
at Volo.Abp.AbpApplicationBase.InitializeModules() in D:\Github\abp\framework\src\Volo.Abp.Core\Volo\Abp\AbpApplicationBase.cs:line 72
at Volo.Abp.AbpApplicationWithExternalServiceProvider.Initialize(IServiceProvider serviceProvider) in D:\Github\abp\framework\src\Volo.Abp.Core\Volo\Abp\AbpApplicationWithExternalServiceProvider.cs:line 27
at Microsoft.AspNetCore.Builder.AbpApplicationBuilderExtensions.InitializeApplication(IApplicationBuilder app) in D:\Github\abp\framework\src\Volo.Abp.AspNetCore\Microsoft\AspNetCore\Builder\AbpApplicationBuilderExtensions.cs:line 27
at MyCompanyName.MyProjectName.Host.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) in D:\Github\abp\templates\service\host\MyCompanyName.MyProjectName.Host\Startup.cs:line 24
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Microsoft.AspNetCore.Hosting.Internal.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.Internal.ConfigureBuilder.<>c__DisplayClass4_0.<Build>b__0(IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
at Microsoft.AspNetCore.Server.IISIntegration.IISSetupFilter.<>c__DisplayClass4_0.<Configure>b__0(IApplicationBuilder app)
at Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
at Microsoft.AspNetCore.Hosting.Internal.WebHost.StartAsync(CancellationToken cancellationToken)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.StartAsync(CancellationToken cancellationToken)
at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token, String shutdownMessage)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token, String shutdownMessage)
at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token)
at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host)
at MyCompanyName.MyProjectName.Host.Program.Main(String[] args) in D:\Github\abp\templates\service\host\MyCompanyName.MyProjectName.Host\Program.cs:line 23
2018-10-30 18:17:37.600 +03:00 [DBG] END SaveChangesAsync:True
2018-10-30 18:17:37.737 +03:00 [INF] Initialized all modules.
2018-10-30 18:17:37.941 +03:00 [INF] Request starting HTTP/1.1 GET http://localhost:57992/
2018-10-30 18:17:38.105 +03:00 [INF] Route matched with {action = "Index", controller = "Home", area = ""}. Executing action MyCompanyName.MyProjectName.Host.Controllers.HomeController.Index (MyCompanyName.MyProjectName.Host)
2018-10-30 18:17:38.126 +03:00 [INF] Executing action method MyCompanyName.MyProjectName.Host.Controllers.HomeController.Index (MyCompanyName.MyProjectName.Host) - Validation state: "Valid"
2018-10-30 18:17:38.131 +03:00 [INF] Executed action method MyCompanyName.MyProjectName.Host.Controllers.HomeController.Index (MyCompanyName.MyProjectName.Host), returned result Microsoft.AspNetCore.Mvc.RedirectResult in 0.1369ms.
2018-10-30 18:17:38.137 +03:00 [INF] Executing RedirectResult, redirecting to /swagger.
2018-10-30 18:17:38.140 +03:00 [INF] Executed action MyCompanyName.MyProjectName.Host.Controllers.HomeController.Index (MyCompanyName.MyProjectName.Host) in 31.4434ms
2018-10-30 18:17:38.145 +03:00 [INF] Request finished in 205.9632ms 302
2018-10-30 18:17:38.163 +03:00 [INF] Request starting HTTP/1.1 GET http://localhost:57992/swagger/
2018-10-30 18:17:38.171 +03:00 [INF] Request finished in 8.1569ms 200 text/html
2018-10-30 18:17:38.401 +03:00 [INF] Request starting HTTP/1.1 GET http://localhost:57992/swagger/v1/swagger.json
2018-10-30 18:17:38.581 +03:00 [INF] Request finished in 179.8033ms 200 application/json
2019-01-07 14:46:19.756 +03:00 [INF] Starting web host.
2019-01-07 14:46:21.104 +03:00 [INF] User profile is available. Using 'C:\Users\halil\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
2019-01-07 14:46:21.168 +03:00 [INF] Loaded modules:
2019-01-07 14:46:21.168 +03:00 [INF] - Volo.Abp.Castle.AbpCastleCoreModule
2019-01-07 14:46:21.168 +03:00 [INF] - Volo.Abp.Autofac.AbpAutofacModule
2019-01-07 14:46:21.168 +03:00 [INF] - Volo.Abp.VirtualFileSystem.AbpVirtualFileSystemModule
2019-01-07 14:46:21.168 +03:00 [INF] - Volo.Abp.Localization.AbpLocalizationAbstractionsModule
2019-01-07 14:46:21.168 +03:00 [INF] - Volo.Abp.Security.AbpSecurityModule
2019-01-07 14:46:21.168 +03:00 [INF] - Volo.Abp.Settings.AbpSettingsModule
2019-01-07 14:46:21.168 +03:00 [INF] - Volo.Abp.Localization.AbpLocalizationModule
2019-01-07 14:46:21.168 +03:00 [INF] - MyCompanyName.MyProjectName.MyProjectNameDomainSharedModule
2019-01-07 14:46:21.168 +03:00 [INF] - MyCompanyName.MyProjectName.MyProjectNameDomainModule
2019-01-07 14:46:21.168 +03:00 [INF] - Volo.Abp.Data.AbpDataModule
2019-01-07 14:46:21.168 +03:00 [INF] - Volo.Abp.Timing.AbpTimingModule
2019-01-07 14:46:21.168 +03:00 [INF] - Volo.Abp.Json.AbpJsonModule
2019-01-07 14:46:21.168 +03:00 [INF] - Volo.Abp.Threading.AbpThreadingModule
2019-01-07 14:46:21.168 +03:00 [INF] - Volo.Abp.MultiTenancy.AbpMultiTenancyAbstractionsModule
2019-01-07 14:46:21.168 +03:00 [INF] - Volo.Abp.Auditing.AbpAuditingModule
2019-01-07 14:46:21.168 +03:00 [INF] - Volo.Abp.EventBus.AbpEventBusModule
2019-01-07 14:46:21.168 +03:00 [INF] - Volo.Abp.Guids.AbpGuidsModule
2019-01-07 14:46:21.168 +03:00 [INF] - Volo.Abp.Uow.AbpUnitOfWorkModule
2019-01-07 14:46:21.168 +03:00 [INF] - Volo.Abp.ObjectMapping.AbpObjectMappingModule
2019-01-07 14:46:21.168 +03:00 [INF] - Volo.Abp.Domain.AbpDddDomainModule
2019-01-07 14:46:21.168 +03:00 [INF] - Volo.Abp.Validation.AbpValidationModule
2019-01-07 14:46:21.168 +03:00 [INF] - Volo.Abp.Authorization.AbpAuthorizationModule
2019-01-07 14:46:21.168 +03:00 [INF] - Volo.Abp.Http.AbpHttpAbstractionsModule
2019-01-07 14:46:21.168 +03:00 [INF] - Volo.Abp.Application.AbpDddApplicationModule
2019-01-07 14:46:21.168 +03:00 [INF] - MyCompanyName.MyProjectName.MyProjectNameApplicationContractsModule
2019-01-07 14:46:21.168 +03:00 [INF] - Volo.Abp.AutoMapper.AbpAutoMapperModule
2019-01-07 14:46:21.168 +03:00 [INF] - MyCompanyName.MyProjectName.MyProjectNameApplicationModule
2019-01-07 14:46:21.169 +03:00 [INF] - Volo.Abp.EntityFrameworkCore.AbpEntityFrameworkCoreModule
2019-01-07 14:46:21.169 +03:00 [INF] - MyCompanyName.MyProjectName.EntityFrameworkCore.MyProjectNameEntityFrameworkCoreModule
2019-01-07 14:46:21.169 +03:00 [INF] - Volo.Abp.Http.AbpHttpModule
2019-01-07 14:46:21.169 +03:00 [INF] - Volo.Abp.UI.AbpUiModule
2019-01-07 14:46:21.169 +03:00 [INF] - Volo.Abp.AspNetCore.AbpAspNetCoreModule
2019-01-07 14:46:21.169 +03:00 [INF] - Volo.Abp.ApiVersioning.AbpApiVersioningAbstractionsModule
2019-01-07 14:46:21.169 +03:00 [INF] - Volo.Abp.AspNetCore.Mvc.AbpAspNetCoreMvcModule
2019-01-07 14:46:21.169 +03:00 [INF] - MyCompanyName.MyProjectName.MyProjectNameHttpApiModule
2019-01-07 14:46:21.169 +03:00 [INF] - Volo.Abp.PermissionManagement.AbpPermissionManagementDomainSharedModule
2019-01-07 14:46:21.169 +03:00 [INF] - Volo.Abp.Serialization.AbpSerializationModule
2019-01-07 14:46:21.169 +03:00 [INF] - Volo.Abp.Caching.AbpCachingModule
2019-01-07 14:46:21.169 +03:00 [INF] - Volo.Abp.PermissionManagement.AbpPermissionManagementDomainModule
2019-01-07 14:46:21.169 +03:00 [INF] - Volo.Abp.PermissionManagement.EntityFrameworkCore.AbpPermissionManagementEntityFrameworkCoreModule
2019-01-07 14:46:21.169 +03:00 [INF] - Volo.Abp.SettingManagement.AbpSettingManagementDomainSharedModule
2019-01-07 14:46:21.169 +03:00 [INF] - Volo.Abp.SettingManagement.AbpSettingManagementDomainModule
2019-01-07 14:46:21.169 +03:00 [INF] - Volo.Abp.SettingManagement.EntityFrameworkCore.AbpSettingManagementEntityFrameworkCoreModule
2019-01-07 14:46:21.169 +03:00 [INF] - Volo.Abp.AuditLogging.AbpAuditLoggingDomainSharedModule
2019-01-07 14:46:21.169 +03:00 [INF] - Volo.Abp.AuditLogging.AbpAuditLoggingDomainModule
2019-01-07 14:46:21.169 +03:00 [INF] - Volo.Abp.AuditLogging.EntityFrameworkCore.AbpAuditLoggingEntityFrameworkCoreModule
2019-01-07 14:46:21.169 +03:00 [INF] - Volo.Abp.EntityFrameworkCore.SqlServer.AbpEntityFrameworkCoreSqlServerModule
2019-01-07 14:46:21.169 +03:00 [INF] - MyCompanyName.MyProjectName.Host.DemoAppModule
2019-01-07 14:46:21.213 +03:00 [DBG] No class found with auto mapping attributes.
2019-01-07 14:46:21.668 +03:00 [FTL] Application startup exception
System.Data.SqlClient.SqlException (0x80131904): Cannot open database "MyProjectNameCache" requested by the login. The login failed.
Login failed for user 'MicrosoftAccount\halilibrahimkalkan@outlook.com'.
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionPool.WaitForPendingOpen()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Extensions.Caching.SqlServer.DatabaseOperations.GetCacheItemAsync(String key, Boolean includeValue, CancellationToken token)
at Microsoft.Extensions.Caching.SqlServer.DatabaseOperations.GetCacheItemAsync(String key, CancellationToken token)
at Microsoft.Extensions.Caching.SqlServer.SqlServerCache.GetAsync(String key, CancellationToken token)
at Volo.Abp.Caching.DistributedCache`1.GetAsync(String key, CancellationToken token) in D:\Github\abp\framework\src\Volo.Abp.Caching\Volo\Abp\Caching\DistributedCache.cs:line 57
at Volo.Abp.SettingManagement.SettingStore.GetCacheItemAsync(String name, String providerName, String providerKey) in D:\Github\abp\modules\setting-management\src\Volo.Abp.SettingManagement.Domain\Volo\Abp\SettingManagement\SettingStore.cs:line 66
at Volo.Abp.SettingManagement.SettingStore.GetOrNullAsync(String name, String providerName, String providerKey) in D:\Github\abp\modules\setting-management\src\Volo.Abp.SettingManagement.Domain\Volo\Abp\SettingManagement\SettingStore.cs:line 29
at Volo.Abp.Settings.SettingManager.GetOrNullValueFromProvidersAsync(String providerKey, IEnumerable`1 providers, SettingDefinition setting) in D:\Github\abp\framework\src\Volo.Abp.Settings\Volo\Abp\Settings\SettingManager.cs:line 217
at Volo.Abp.Settings.SettingManager.GetOrNullInternalAsync(String name, String providerName, String providerKey, Boolean fallback) in D:\Github\abp\framework\src\Volo.Abp.Settings\Volo\Abp\Settings\SettingManager.cs:line 201
at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException[TResult](Task`1 task)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException[TResult](Task`1 task)
at Nito.AsyncEx.AsyncContext.Run[TResult](Func`1 action)
at Volo.Abp.Threading.AsyncHelper.RunSync[TResult](Func`1 func) in D:\Github\abp\framework\src\Volo.Abp.Core\Volo\Abp\Threading\AsyncHelper.cs:line 60
at Volo.Abp.Settings.SettingManagerSyncExtensions.GetOrNull(ISettingManager settingManager, String name) in D:\Github\abp\framework\src\Volo.Abp.Settings\Volo\Abp\Settings\SettingManagerSyncExtensions.cs:line 13
at Microsoft.AspNetCore.Builder.AbpApplicationBuilderExtensions.UseAbpRequestLocalization(IApplicationBuilder app) in D:\Github\abp\framework\src\Volo.Abp.AspNetCore\Microsoft\AspNetCore\Builder\AbpApplicationBuilderExtensions.cs:line 54
at MyCompanyName.MyProjectName.Host.DemoAppModule.OnApplicationInitialization(ApplicationInitializationContext context) in D:\Github\abp\templates\service\host\MyCompanyName.MyProjectName.Host\DemoAppModule.cs:line 109
at Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor.Initialize(ApplicationInitializationContext context, IAbpModule module) in D:\Github\abp\framework\src\Volo.Abp.Core\Volo\Abp\Modularity\DefaultModuleLifecycleContributor.cs:line 7
at Volo.Abp.Modularity.ModuleManager.InitializeModules(ApplicationInitializationContext context) in D:\Github\abp\framework\src\Volo.Abp.Core\Volo\Abp\Modularity\ModuleManager.cs:line 41
at Volo.Abp.AbpApplicationBase.InitializeModules() in D:\Github\abp\framework\src\Volo.Abp.Core\Volo\Abp\AbpApplicationBase.cs:line 72
at Volo.Abp.AbpApplicationWithExternalServiceProvider.Initialize(IServiceProvider serviceProvider) in D:\Github\abp\framework\src\Volo.Abp.Core\Volo\Abp\AbpApplicationWithExternalServiceProvider.cs:line 27
at Microsoft.AspNetCore.Builder.AbpApplicationBuilderExtensions.InitializeApplication(IApplicationBuilder app) in D:\Github\abp\framework\src\Volo.Abp.AspNetCore\Microsoft\AspNetCore\Builder\AbpApplicationBuilderExtensions.cs:line 27
at MyCompanyName.MyProjectName.Host.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) in D:\Github\abp\templates\service\host\MyCompanyName.MyProjectName.Host\Startup.cs:line 24
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
at Microsoft.AspNetCore.Mvc.Internal.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.<Configure>g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
at Microsoft.AspNetCore.Server.IISIntegration.IISSetupFilter.<>c__DisplayClass4_0.<Configure>b__0(IApplicationBuilder app)
at Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
ClientConnectionId:f4f9905c-c66c-41ee-8497-649f2e111e03
Error Number:4060,State:1,Class:11
2019-01-07 14:46:22.022 +03:00 [INF] Request starting HTTP/1.1 GET http://localhost:57992/
2019-01-07 14:46:22.061 +03:00 [INF] Request finished in 39.0742ms 500 text/html; charset=utf-8
2019-01-07 14:46:39.070 +03:00 [INF] Request starting HTTP/1.1 GET http://localhost:57992/
2019-01-07 14:46:39.085 +03:00 [INF] Request finished in 14.9782ms 500 text/html; charset=utf-8
2019-01-07 14:46:48.817 +03:00 [INF] Request starting HTTP/1.1 GET http://localhost:57992/
2019-01-07 14:46:48.855 +03:00 [INF] Request finished in 38.2239ms 500 text/html; charset=utf-8
2019-01-07 14:47:42.990 +03:00 [INF] Starting web host.
2019-01-07 14:47:44.287 +03:00 [INF] User profile is available. Using 'C:\Users\halil\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
2019-01-07 14:47:44.347 +03:00 [INF] Loaded modules:
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.Castle.AbpCastleCoreModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.Autofac.AbpAutofacModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.VirtualFileSystem.AbpVirtualFileSystemModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.Localization.AbpLocalizationAbstractionsModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.Security.AbpSecurityModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.Settings.AbpSettingsModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.Localization.AbpLocalizationModule
2019-01-07 14:47:44.347 +03:00 [INF] - MyCompanyName.MyProjectName.MyProjectNameDomainSharedModule
2019-01-07 14:47:44.347 +03:00 [INF] - MyCompanyName.MyProjectName.MyProjectNameDomainModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.Data.AbpDataModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.Timing.AbpTimingModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.Json.AbpJsonModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.Threading.AbpThreadingModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.MultiTenancy.AbpMultiTenancyAbstractionsModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.Auditing.AbpAuditingModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.EventBus.AbpEventBusModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.Guids.AbpGuidsModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.Uow.AbpUnitOfWorkModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.ObjectMapping.AbpObjectMappingModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.Domain.AbpDddDomainModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.Validation.AbpValidationModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.Authorization.AbpAuthorizationModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.Http.AbpHttpAbstractionsModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.Application.AbpDddApplicationModule
2019-01-07 14:47:44.347 +03:00 [INF] - MyCompanyName.MyProjectName.MyProjectNameApplicationContractsModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.AutoMapper.AbpAutoMapperModule
2019-01-07 14:47:44.347 +03:00 [INF] - MyCompanyName.MyProjectName.MyProjectNameApplicationModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.EntityFrameworkCore.AbpEntityFrameworkCoreModule
2019-01-07 14:47:44.347 +03:00 [INF] - MyCompanyName.MyProjectName.EntityFrameworkCore.MyProjectNameEntityFrameworkCoreModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.Http.AbpHttpModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.UI.AbpUiModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.AspNetCore.AbpAspNetCoreModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.ApiVersioning.AbpApiVersioningAbstractionsModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.AspNetCore.Mvc.AbpAspNetCoreMvcModule
2019-01-07 14:47:44.347 +03:00 [INF] - MyCompanyName.MyProjectName.MyProjectNameHttpApiModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.PermissionManagement.AbpPermissionManagementDomainSharedModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.Serialization.AbpSerializationModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.Caching.AbpCachingModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.PermissionManagement.AbpPermissionManagementDomainModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.PermissionManagement.EntityFrameworkCore.AbpPermissionManagementEntityFrameworkCoreModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.SettingManagement.AbpSettingManagementDomainSharedModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.SettingManagement.AbpSettingManagementDomainModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.SettingManagement.EntityFrameworkCore.AbpSettingManagementEntityFrameworkCoreModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.AuditLogging.AbpAuditLoggingDomainSharedModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.AuditLogging.AbpAuditLoggingDomainModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.AuditLogging.EntityFrameworkCore.AbpAuditLoggingEntityFrameworkCoreModule
2019-01-07 14:47:44.347 +03:00 [INF] - Volo.Abp.EntityFrameworkCore.SqlServer.AbpEntityFrameworkCoreSqlServerModule
2019-01-07 14:47:44.347 +03:00 [INF] - MyCompanyName.MyProjectName.Host.DemoAppModule
2019-01-07 14:47:44.390 +03:00 [DBG] No class found with auto mapping attributes.
2019-01-07 14:47:44.806 +03:00 [FTL] Application startup exception
System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'dbo.TestCache'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.CompleteAsyncExecuteReader()
at System.Data.SqlClient.SqlCommand.InternalEndExecuteReader(IAsyncResult asyncResult, String endMethod)
at System.Data.SqlClient.SqlCommand.EndExecuteReaderInternal(IAsyncResult asyncResult)
at System.Data.SqlClient.SqlCommand.EndExecuteReader(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Extensions.Caching.SqlServer.DatabaseOperations.GetCacheItemAsync(String key, Boolean includeValue, CancellationToken token)
at Microsoft.Extensions.Caching.SqlServer.DatabaseOperations.GetCacheItemAsync(String key, CancellationToken token)
at Microsoft.Extensions.Caching.SqlServer.SqlServerCache.GetAsync(String key, CancellationToken token)
at Volo.Abp.Caching.DistributedCache`1.GetAsync(String key, CancellationToken token) in D:\Github\abp\framework\src\Volo.Abp.Caching\Volo\Abp\Caching\DistributedCache.cs:line 57
at Volo.Abp.SettingManagement.SettingStore.GetCacheItemAsync(String name, String providerName, String providerKey) in D:\Github\abp\modules\setting-management\src\Volo.Abp.SettingManagement.Domain\Volo\Abp\SettingManagement\SettingStore.cs:line 66
at Volo.Abp.SettingManagement.SettingStore.GetOrNullAsync(String name, String providerName, String providerKey) in D:\Github\abp\modules\setting-management\src\Volo.Abp.SettingManagement.Domain\Volo\Abp\SettingManagement\SettingStore.cs:line 29
at Volo.Abp.Settings.SettingManager.GetOrNullValueFromProvidersAsync(String providerKey, IEnumerable`1 providers, SettingDefinition setting) in D:\Github\abp\framework\src\Volo.Abp.Settings\Volo\Abp\Settings\SettingManager.cs:line 217
at Volo.Abp.Settings.SettingManager.GetOrNullInternalAsync(String name, String providerName, String providerKey, Boolean fallback) in D:\Github\abp\framework\src\Volo.Abp.Settings\Volo\Abp\Settings\SettingManager.cs:line 201
at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException[TResult](Task`1 task)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException[TResult](Task`1 task)
at Nito.AsyncEx.AsyncContext.Run[TResult](Func`1 action)
at Volo.Abp.Threading.AsyncHelper.RunSync[TResult](Func`1 func) in D:\Github\abp\framework\src\Volo.Abp.Core\Volo\Abp\Threading\AsyncHelper.cs:line 60
at Volo.Abp.Settings.SettingManagerSyncExtensions.GetOrNull(ISettingManager settingManager, String name) in D:\Github\abp\framework\src\Volo.Abp.Settings\Volo\Abp\Settings\SettingManagerSyncExtensions.cs:line 13
at Microsoft.AspNetCore.Builder.AbpApplicationBuilderExtensions.UseAbpRequestLocalization(IApplicationBuilder app) in D:\Github\abp\framework\src\Volo.Abp.AspNetCore\Microsoft\AspNetCore\Builder\AbpApplicationBuilderExtensions.cs:line 54
at MyCompanyName.MyProjectName.Host.DemoAppModule.OnApplicationInitialization(ApplicationInitializationContext context) in D:\Github\abp\templates\service\host\MyCompanyName.MyProjectName.Host\DemoAppModule.cs:line 109
at Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor.Initialize(ApplicationInitializationContext context, IAbpModule module) in D:\Github\abp\framework\src\Volo.Abp.Core\Volo\Abp\Modularity\DefaultModuleLifecycleContributor.cs:line 7
at Volo.Abp.Modularity.ModuleManager.InitializeModules(ApplicationInitializationContext context) in D:\Github\abp\framework\src\Volo.Abp.Core\Volo\Abp\Modularity\ModuleManager.cs:line 41
at Volo.Abp.AbpApplicationBase.InitializeModules() in D:\Github\abp\framework\src\Volo.Abp.Core\Volo\Abp\AbpApplicationBase.cs:line 72
at Volo.Abp.AbpApplicationWithExternalServiceProvider.Initialize(IServiceProvider serviceProvider) in D:\Github\abp\framework\src\Volo.Abp.Core\Volo\Abp\AbpApplicationWithExternalServiceProvider.cs:line 27
at Microsoft.AspNetCore.Builder.AbpApplicationBuilderExtensions.InitializeApplication(IApplicationBuilder app) in D:\Github\abp\framework\src\Volo.Abp.AspNetCore\Microsoft\AspNetCore\Builder\AbpApplicationBuilderExtensions.cs:line 27
at MyCompanyName.MyProjectName.Host.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) in D:\Github\abp\templates\service\host\MyCompanyName.MyProjectName.Host\Startup.cs:line 24
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
at Microsoft.AspNetCore.Mvc.Internal.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.<Configure>g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
at Microsoft.AspNetCore.Server.IISIntegration.IISSetupFilter.<>c__DisplayClass4_0.<Configure>b__0(IApplicationBuilder app)
at Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
ClientConnectionId:d28745af-08b1-4111-a089-3f46c995c65d
Error Number:208,State:1,Class:16
2019-01-07 14:47:44.964 +03:00 [INF] Request starting HTTP/1.1 GET http://localhost:57992/
2019-01-07 14:47:44.998 +03:00 [INF] Request finished in 33.8928ms 500 text/html; charset=utf-8

302
templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20190410095222_Initial.Designer.cs

@ -1,302 +0,0 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using MyCompanyName.MyProjectName.Host;
namespace MyCompanyName.MyProjectName.Host.Migrations
{
[DbContext(typeof(DemoAppDbContext))]
[Migration("20190410095222_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ApplicationName")
.HasColumnName("ApplicationName")
.HasMaxLength(96);
b.Property<string>("BrowserInfo")
.HasColumnName("BrowserInfo")
.HasMaxLength(512);
b.Property<string>("ClientId")
.HasColumnName("ClientId")
.HasMaxLength(64);
b.Property<string>("ClientIpAddress")
.HasColumnName("ClientIpAddress")
.HasMaxLength(64);
b.Property<string>("ClientName")
.HasColumnName("ClientName")
.HasMaxLength(128);
b.Property<string>("Comments")
.HasColumnName("Comments")
.HasMaxLength(256);
b.Property<string>("ConcurrencyStamp");
b.Property<string>("CorrelationId")
.HasColumnName("CorrelationId")
.HasMaxLength(64);
b.Property<string>("Exceptions")
.HasColumnName("Exceptions")
.HasMaxLength(4000);
b.Property<int>("ExecutionDuration")
.HasColumnName("ExecutionDuration");
b.Property<DateTime>("ExecutionTime");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<string>("HttpMethod")
.HasColumnName("HttpMethod")
.HasMaxLength(16);
b.Property<int?>("HttpStatusCode")
.HasColumnName("HttpStatusCode");
b.Property<Guid?>("ImpersonatorTenantId")
.HasColumnName("ImpersonatorTenantId");
b.Property<Guid?>("ImpersonatorUserId")
.HasColumnName("ImpersonatorUserId");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId");
b.Property<string>("TenantName");
b.Property<string>("Url")
.HasColumnName("Url")
.HasMaxLength(256);
b.Property<Guid?>("UserId")
.HasColumnName("UserId");
b.Property<string>("UserName")
.HasColumnName("UserName")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("TenantId", "ExecutionTime");
b.HasIndex("TenantId", "UserId", "ExecutionTime");
b.ToTable("AbpAuditLogs");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<Guid>("AuditLogId")
.HasColumnName("AuditLogId");
b.Property<int>("ExecutionDuration")
.HasColumnName("ExecutionDuration");
b.Property<DateTime>("ExecutionTime")
.HasColumnName("ExecutionTime");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<string>("MethodName")
.HasColumnName("MethodName")
.HasMaxLength(128);
b.Property<string>("Parameters")
.HasColumnName("Parameters")
.HasMaxLength(2000);
b.Property<string>("ServiceName")
.HasColumnName("ServiceName")
.HasMaxLength(256);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("AuditLogId");
b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime");
b.ToTable("AbpAuditLogActions");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<Guid>("AuditLogId")
.HasColumnName("AuditLogId");
b.Property<DateTime>("ChangeTime")
.HasColumnName("ChangeTime");
b.Property<byte>("ChangeType")
.HasColumnName("ChangeType");
b.Property<string>("EntityId")
.IsRequired()
.HasColumnName("EntityId")
.HasMaxLength(128);
b.Property<Guid?>("EntityTenantId");
b.Property<string>("EntityTypeFullName")
.IsRequired()
.HasColumnName("EntityTypeFullName")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId");
b.HasKey("Id");
b.HasIndex("AuditLogId");
b.HasIndex("TenantId", "EntityTypeFullName", "EntityId");
b.ToTable("AbpEntityChanges");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<Guid>("EntityChangeId");
b.Property<string>("NewValue")
.HasColumnName("NewValue")
.HasMaxLength(512);
b.Property<string>("OriginalValue")
.HasColumnName("OriginalValue")
.HasMaxLength(512);
b.Property<string>("PropertyName")
.IsRequired()
.HasColumnName("PropertyName")
.HasMaxLength(128);
b.Property<string>("PropertyTypeFullName")
.IsRequired()
.HasColumnName("PropertyTypeFullName")
.HasMaxLength(64);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("EntityChangeId");
b.ToTable("AbpEntityPropertyChanges");
});
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.IsRequired()
.HasMaxLength(64);
b.Property<string>("ProviderName")
.IsRequired()
.HasMaxLength(64);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpPermissionGrants");
});
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(2048);
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpSettings");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany("Actions")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany("EntityChanges")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.EntityChange")
.WithMany("PropertyChanges")
.HasForeignKey("EntityChangeId")
.OnDelete(DeleteBehavior.Cascade);
});
#pragma warning restore 612, 618
}
}
}

212
templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20190410095222_Initial.cs

@ -1,212 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace MyCompanyName.MyProjectName.Host.Migrations
{
public partial class Initial : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AbpAuditLogs",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
ApplicationName = table.Column<string>(maxLength: 96, nullable: true),
UserId = table.Column<Guid>(nullable: true),
UserName = table.Column<string>(maxLength: 256, nullable: true),
TenantId = table.Column<Guid>(nullable: true),
TenantName = table.Column<string>(nullable: true),
ImpersonatorUserId = table.Column<Guid>(nullable: true),
ImpersonatorTenantId = table.Column<Guid>(nullable: true),
ExecutionTime = table.Column<DateTime>(nullable: false),
ExecutionDuration = table.Column<int>(nullable: false),
ClientIpAddress = table.Column<string>(maxLength: 64, nullable: true),
ClientName = table.Column<string>(maxLength: 128, nullable: true),
ClientId = table.Column<string>(maxLength: 64, nullable: true),
CorrelationId = table.Column<string>(maxLength: 64, nullable: true),
BrowserInfo = table.Column<string>(maxLength: 512, nullable: true),
HttpMethod = table.Column<string>(maxLength: 16, nullable: true),
Url = table.Column<string>(maxLength: 256, nullable: true),
Exceptions = table.Column<string>(maxLength: 4000, nullable: true),
Comments = table.Column<string>(maxLength: 256, nullable: true),
HttpStatusCode = table.Column<int>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpAuditLogs", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpPermissionGrants",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
Name = table.Column<string>(maxLength: 128, nullable: false),
ProviderName = table.Column<string>(maxLength: 64, nullable: false),
ProviderKey = table.Column<string>(maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpSettings",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
Name = table.Column<string>(maxLength: 128, nullable: false),
Value = table.Column<string>(maxLength: 2048, nullable: false),
ProviderName = table.Column<string>(maxLength: 64, nullable: true),
ProviderKey = table.Column<string>(maxLength: 64, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpSettings", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpAuditLogActions",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
AuditLogId = table.Column<Guid>(nullable: false),
ServiceName = table.Column<string>(maxLength: 256, nullable: true),
MethodName = table.Column<string>(maxLength: 128, nullable: true),
Parameters = table.Column<string>(maxLength: 2000, nullable: true),
ExecutionTime = table.Column<DateTime>(nullable: false),
ExecutionDuration = table.Column<int>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpAuditLogActions", x => x.Id);
table.ForeignKey(
name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId",
column: x => x.AuditLogId,
principalTable: "AbpAuditLogs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpEntityChanges",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
AuditLogId = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
ChangeTime = table.Column<DateTime>(nullable: false),
ChangeType = table.Column<byte>(nullable: false),
EntityTenantId = table.Column<Guid>(nullable: true),
EntityId = table.Column<string>(maxLength: 128, nullable: false),
EntityTypeFullName = table.Column<string>(maxLength: 128, nullable: false),
ExtraProperties = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpEntityChanges", x => x.Id);
table.ForeignKey(
name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId",
column: x => x.AuditLogId,
principalTable: "AbpAuditLogs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpEntityPropertyChanges",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
EntityChangeId = table.Column<Guid>(nullable: false),
NewValue = table.Column<string>(maxLength: 512, nullable: true),
OriginalValue = table.Column<string>(maxLength: 512, nullable: true),
PropertyName = table.Column<string>(maxLength: 128, nullable: false),
PropertyTypeFullName = table.Column<string>(maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpEntityPropertyChanges", x => x.Id);
table.ForeignKey(
name: "FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId",
column: x => x.EntityChangeId,
principalTable: "AbpEntityChanges",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogActions_AuditLogId",
table: "AbpAuditLogActions",
column: "AuditLogId");
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_ExecutionTime",
table: "AbpAuditLogActions",
columns: new[] { "TenantId", "ServiceName", "MethodName", "ExecutionTime" });
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogs_TenantId_ExecutionTime",
table: "AbpAuditLogs",
columns: new[] { "TenantId", "ExecutionTime" });
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogs_TenantId_UserId_ExecutionTime",
table: "AbpAuditLogs",
columns: new[] { "TenantId", "UserId", "ExecutionTime" });
migrationBuilder.CreateIndex(
name: "IX_AbpEntityChanges_AuditLogId",
table: "AbpEntityChanges",
column: "AuditLogId");
migrationBuilder.CreateIndex(
name: "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId",
table: "AbpEntityChanges",
columns: new[] { "TenantId", "EntityTypeFullName", "EntityId" });
migrationBuilder.CreateIndex(
name: "IX_AbpEntityPropertyChanges_EntityChangeId",
table: "AbpEntityPropertyChanges",
column: "EntityChangeId");
migrationBuilder.CreateIndex(
name: "IX_AbpPermissionGrants_Name_ProviderName_ProviderKey",
table: "AbpPermissionGrants",
columns: new[] { "Name", "ProviderName", "ProviderKey" });
migrationBuilder.CreateIndex(
name: "IX_AbpSettings_Name_ProviderName_ProviderKey",
table: "AbpSettings",
columns: new[] { "Name", "ProviderName", "ProviderKey" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AbpAuditLogActions");
migrationBuilder.DropTable(
name: "AbpEntityPropertyChanges");
migrationBuilder.DropTable(
name: "AbpPermissionGrants");
migrationBuilder.DropTable(
name: "AbpSettings");
migrationBuilder.DropTable(
name: "AbpEntityChanges");
migrationBuilder.DropTable(
name: "AbpAuditLogs");
}
}
}

300
templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/DemoAppDbContextModelSnapshot.cs

@ -1,300 +0,0 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using MyCompanyName.MyProjectName.Host;
namespace MyCompanyName.MyProjectName.Host.Migrations
{
[DbContext(typeof(DemoAppDbContext))]
partial class DemoAppDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ApplicationName")
.HasColumnName("ApplicationName")
.HasMaxLength(96);
b.Property<string>("BrowserInfo")
.HasColumnName("BrowserInfo")
.HasMaxLength(512);
b.Property<string>("ClientId")
.HasColumnName("ClientId")
.HasMaxLength(64);
b.Property<string>("ClientIpAddress")
.HasColumnName("ClientIpAddress")
.HasMaxLength(64);
b.Property<string>("ClientName")
.HasColumnName("ClientName")
.HasMaxLength(128);
b.Property<string>("Comments")
.HasColumnName("Comments")
.HasMaxLength(256);
b.Property<string>("ConcurrencyStamp");
b.Property<string>("CorrelationId")
.HasColumnName("CorrelationId")
.HasMaxLength(64);
b.Property<string>("Exceptions")
.HasColumnName("Exceptions")
.HasMaxLength(4000);
b.Property<int>("ExecutionDuration")
.HasColumnName("ExecutionDuration");
b.Property<DateTime>("ExecutionTime");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<string>("HttpMethod")
.HasColumnName("HttpMethod")
.HasMaxLength(16);
b.Property<int?>("HttpStatusCode")
.HasColumnName("HttpStatusCode");
b.Property<Guid?>("ImpersonatorTenantId")
.HasColumnName("ImpersonatorTenantId");
b.Property<Guid?>("ImpersonatorUserId")
.HasColumnName("ImpersonatorUserId");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId");
b.Property<string>("TenantName");
b.Property<string>("Url")
.HasColumnName("Url")
.HasMaxLength(256);
b.Property<Guid?>("UserId")
.HasColumnName("UserId");
b.Property<string>("UserName")
.HasColumnName("UserName")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("TenantId", "ExecutionTime");
b.HasIndex("TenantId", "UserId", "ExecutionTime");
b.ToTable("AbpAuditLogs");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<Guid>("AuditLogId")
.HasColumnName("AuditLogId");
b.Property<int>("ExecutionDuration")
.HasColumnName("ExecutionDuration");
b.Property<DateTime>("ExecutionTime")
.HasColumnName("ExecutionTime");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<string>("MethodName")
.HasColumnName("MethodName")
.HasMaxLength(128);
b.Property<string>("Parameters")
.HasColumnName("Parameters")
.HasMaxLength(2000);
b.Property<string>("ServiceName")
.HasColumnName("ServiceName")
.HasMaxLength(256);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("AuditLogId");
b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime");
b.ToTable("AbpAuditLogActions");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<Guid>("AuditLogId")
.HasColumnName("AuditLogId");
b.Property<DateTime>("ChangeTime")
.HasColumnName("ChangeTime");
b.Property<byte>("ChangeType")
.HasColumnName("ChangeType");
b.Property<string>("EntityId")
.IsRequired()
.HasColumnName("EntityId")
.HasMaxLength(128);
b.Property<Guid?>("EntityTenantId");
b.Property<string>("EntityTypeFullName")
.IsRequired()
.HasColumnName("EntityTypeFullName")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId");
b.HasKey("Id");
b.HasIndex("AuditLogId");
b.HasIndex("TenantId", "EntityTypeFullName", "EntityId");
b.ToTable("AbpEntityChanges");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<Guid>("EntityChangeId");
b.Property<string>("NewValue")
.HasColumnName("NewValue")
.HasMaxLength(512);
b.Property<string>("OriginalValue")
.HasColumnName("OriginalValue")
.HasMaxLength(512);
b.Property<string>("PropertyName")
.IsRequired()
.HasColumnName("PropertyName")
.HasMaxLength(128);
b.Property<string>("PropertyTypeFullName")
.IsRequired()
.HasColumnName("PropertyTypeFullName")
.HasMaxLength(64);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("EntityChangeId");
b.ToTable("AbpEntityPropertyChanges");
});
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.IsRequired()
.HasMaxLength(64);
b.Property<string>("ProviderName")
.IsRequired()
.HasMaxLength(64);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpPermissionGrants");
});
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(2048);
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpSettings");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany("Actions")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany("EntityChanges")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.EntityChange")
.WithMany("PropertyChanges")
.HasForeignKey("EntityChangeId")
.OnDelete(DeleteBehavior.Cascade);
});
#pragma warning restore 612, 618
}
}
}

1
templates/service/host/MyCompanyName.MyProjectName.Host/_CreateSqlServerCacheDatabase.bat

@ -1 +0,0 @@
dotnet sql-cache create "Server=localhost;Database=MyProjectName_Cache;Trusted_Connection=True;MultipleActiveResultSets=true" dbo TestCache

15
templates/service/host/MyCompanyName.MyProjectName.Host/appsettings.json

@ -1,15 +0,0 @@
{
"ConnectionStrings": {
"Default": "Server=localhost;Database=MyProjectName_ModuleDb;Trusted_Connection=True;MultipleActiveResultSets=true",
"AbpSettingManagement": "Server=localhost;Database=MyProjectName_Identity;Trusted_Connection=True;MultipleActiveResultSets=true",
"AbpPermissionManagement": "Server=localhost;Database=MyProjectName_Identity;Trusted_Connection=True;MultipleActiveResultSets=true",
"AbpAuditLogging": "Server=localhost;Database=MyProjectName_Identity;Trusted_Connection=True;MultipleActiveResultSets=true",
"SqlServerCache": "Server=localhost;Database=MyProjectName_Cache;Trusted_Connection=True;MultipleActiveResultSets=true"
},
"AuthServer": {
"Authority": "http://localhost:61517"
}
}

2
templates/service/host/MyCompanyName.MyProjectName.Host/Controllers/HomeController.cs → templates/service/host/MyCompanyName.MyProjectName.HttpApi.Host/Controllers/HomeController.cs

@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc;
namespace MyCompanyName.MyProjectName.Host.Controllers
namespace MyCompanyName.MyProjectName.Controllers
{
public class HomeController : AbpController
{

0
templates/service/host/MyCompanyName.MyProjectName.Host/Dockerfile → templates/service/host/MyCompanyName.MyProjectName.HttpApi.Host/Dockerfile

21
templates/service/host/MyCompanyName.MyProjectName.HttpApi.Host/EntityFrameworkCore/MyProjectHttpApiHostMigrationsDbContext.cs

@ -0,0 +1,21 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
namespace MyCompanyName.MyProjectName.EntityFrameworkCore
{
public class MyProjectHttpApiHostMigrationsDbContext : AbpDbContext<MyProjectHttpApiHostMigrationsDbContext>
{
public MyProjectHttpApiHostMigrationsDbContext(DbContextOptions<MyProjectHttpApiHostMigrationsDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.ConfigureMyProjectName();
}
}
}

10
templates/service/host/MyCompanyName.MyProjectName.Host/DemoAppDbContextFactory.cs → templates/service/host/MyCompanyName.MyProjectName.HttpApi.Host/EntityFrameworkCore/MyProjectHttpApiHostMigrationsDbContextFactory.cs

@ -3,18 +3,18 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.Extensions.Configuration;
namespace MyCompanyName.MyProjectName.Host
namespace MyCompanyName.MyProjectName.EntityFrameworkCore
{
public class DemoAppDbContextFactory : IDesignTimeDbContextFactory<DemoAppDbContext>
public class MyProjectHttpApiHostMigrationsDbContextFactory : IDesignTimeDbContextFactory<MyProjectHttpApiHostMigrationsDbContext>
{
public DemoAppDbContext CreateDbContext(string[] args)
public MyProjectHttpApiHostMigrationsDbContext CreateDbContext(string[] args)
{
var configuration = BuildConfiguration();
var builder = new DbContextOptionsBuilder<DemoAppDbContext>()
var builder = new DbContextOptionsBuilder<MyProjectHttpApiHostMigrationsDbContext>()
.UseSqlServer(configuration.GetConnectionString("Default"));
return new DemoAppDbContext(builder.Options);
return new MyProjectHttpApiHostMigrationsDbContext(builder.Options);
}
private static IConfigurationRoot BuildConfiguration()

9
templates/service/host/MyCompanyName.MyProjectName.HttpApi.Host/MultiTenancy/MultiTenancyConsts.cs

@ -0,0 +1,9 @@
namespace MyCompanyName.MyProjectName.MultiTenancy
{
public static class MultiTenancyConsts
{
/* Enable/disable multi-tenancy.
*/
public const bool IsEnabled = false;
}
}

28
templates/service/host/MyCompanyName.MyProjectName.Host/MyCompanyName.MyProjectName.Host.csproj → templates/service/host/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj

@ -1,26 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<RootNamespace>MyCompanyName.MyProjectName</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Serilog.AspNetCore" Version="2.1.1" />
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="2.1.0" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="2.6.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="2.7.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Redis" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="2.2.0" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.MultiTenancy\Volo.Abp.AspNetCore.MultiTenancy.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.EntityFrameworkCore.SqlServer\Volo.Abp.EntityFrameworkCore.SqlServer.csproj" />
<ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.EntityFrameworkCore\Volo.Abp.PermissionManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.EntityFrameworkCore\Volo.Abp.SettingManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.EntityFrameworkCore\Volo.Abp.AuditLogging.EntityFrameworkCore.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\MyCompanyName.MyProjectName.HttpApi\MyCompanyName.MyProjectName.HttpApi.csproj" />
<ProjectReference Include="..\..\src\MyCompanyName.MyProjectName.Application\MyCompanyName.MyProjectName.Application.csproj" />
<ProjectReference Include="..\..\src\MyCompanyName.MyProjectName.EntityFrameworkCore\MyCompanyName.MyProjectName.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.EntityFrameworkCore.SqlServer\Volo.Abp.EntityFrameworkCore.SqlServer.csproj" />
<ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.EntityFrameworkCore\Volo.Abp.PermissionManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.EntityFrameworkCore\Volo.Abp.SettingManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.EntityFrameworkCore\Volo.Abp.AuditLogging.EntityFrameworkCore.csproj" />
</ItemGroup>
<ItemGroup>
@ -30,4 +36,12 @@
<None Remove="Logs\**" />
</ItemGroup>
<Target Name="ChangeAliasesOfStrongNameAssemblies" BeforeTargets="FindReferenceAssembliesForReferences;ResolveReferences">
<ItemGroup>
<ReferencePath Condition="'%(FileName)' == 'StackExchange.Redis.StrongName'">
<Aliases>signed</Aliases>
</ReferencePath>
</ItemGroup>
</Target>
</Project>

72
templates/service/host/MyCompanyName.MyProjectName.Host/DemoAppModule.cs → templates/service/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs

@ -1,59 +1,63 @@
using System.IO;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using MyCompanyName.MyProjectName.EntityFrameworkCore;
using MyCompanyName.MyProjectName.MultiTenancy;
using StackExchange.Redis;
using Swashbuckle.AspNetCore.Swagger;
using Volo.Abp;
using Volo.Abp.AspNetCore.MultiTenancy;
using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.Autofac;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.SqlServer;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.MultiTenancy;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.Security.Claims;
using Volo.Abp.SettingManagement.EntityFrameworkCore;
using Volo.Abp.VirtualFileSystem;
namespace MyCompanyName.MyProjectName.Host
namespace MyCompanyName.MyProjectName
{
[DependsOn(
typeof(AbpAutofacModule),
typeof(MyProjectNameApplicationModule),
typeof(MyProjectNameEntityFrameworkCoreModule),
typeof(MyProjectNameHttpApiModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpAspNetCoreMultiTenancyModule),
typeof(AbpAuditLoggingEntityFrameworkCoreModule),
typeof(AbpEntityFrameworkCoreSqlServerModule)
typeof(AbpAutofacModule),
typeof(AbpEntityFrameworkCoreSqlServerModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule)
)]
public class DemoAppModule : AbpModule
public class MyProjectNameHttpApiHostModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.BuildConfiguration();
Configure<DbConnectionOptions>(options =>
Configure<AbpDbContextOptions>(options =>
{
options.ConnectionStrings.Default = configuration.GetConnectionString("Default");
options.UseSqlServer();
});
Configure<AbpDbContextOptions>(options =>
Configure<MultiTenancyOptions>(options =>
{
options.UseSqlServer();
options.IsEnabled = MultiTenancyConsts.IsEnabled;
});
if (hostingEnvironment.IsDevelopment())
{
Configure<VirtualFileSystemOptions>(options =>
{
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameDomainSharedModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}MyCompanyName.MyProjectName.Domain.Shared", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameDomainModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}MyCompanyName.MyProjectName.Domain", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameApplicationModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}MyCompanyName.MyProjectName.Application", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameApplicationContractsModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}MyCompanyName.MyProjectName.Application.Contracts", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameApplicationModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}MyCompanyName.MyProjectName.Application", Path.DirectorySeparatorChar)));
});
}
@ -68,14 +72,7 @@ namespace MyCompanyName.MyProjectName.Host
Configure<AbpLocalizationOptions>(options =>
{
options.Languages.Add(new LanguageInfo("en", "en", "English"));
//...add other languages
});
context.Services.AddDistributedSqlServerCache(options =>
{
options.ConnectionString = configuration.GetConnectionString("SqlServerCache");
options.SchemaName = "dbo";
options.TableName = "TestCache";
//...you can add other languages
});
context.Services.AddAuthentication("Bearer")
@ -83,32 +80,41 @@ namespace MyCompanyName.MyProjectName.Host
{
options.Authority = configuration["AuthServer:Authority"];
options.RequireHttpsMetadata = false;
options.ApiName = "MyProjectName";
});
options.ApiName = "api1";
context.Services.AddDistributedRedisCache(options =>
{
options.Configuration = configuration["Redis:Configuration"];
});
//TODO: Can we make this by default?
options.InboundJwtClaimTypeMap["sub"] = AbpClaimTypes.UserId;
options.InboundJwtClaimTypeMap["role"] = AbpClaimTypes.Role;
options.InboundJwtClaimTypeMap["email"] = AbpClaimTypes.Email;
});
if (!hostingEnvironment.IsDevelopment())
{
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
context.Services
.AddDataProtection()
.PersistKeysToStackExchangeRedis(redis, "MyProjectName-Protection-Keys");
}
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
app.UseCorrelationId();
app.UseVirtualFiles();
app.UseAuthentication();
if (MultiTenancyConsts.IsEnabled)
{
app.UseMultiTenancy();
}
app.UseAbpRequestLocalization();
app.UseSwagger();
app.UseSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Support APP API");
});
app.UseAuthentication();
app.UseAbpRequestLocalization();
app.UseAuditing();
app.UseMvcWithDefaultRoute();
}
}

6
templates/service/host/MyCompanyName.MyProjectName.Host/Program.cs → templates/service/host/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs

@ -4,14 +4,18 @@ using Microsoft.AspNetCore.Hosting;
using Serilog;
using Serilog.Events;
namespace MyCompanyName.MyProjectName.Host
namespace MyCompanyName.MyProjectName
{
public class Program
{
public static int Main(string[] args)
{
Log.Logger = new LoggerConfiguration()
#if DEBUG
.MinimumLevel.Debug()
#else
.MinimumLevel.Information()
#endif
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
.WriteTo.File("Logs/logs.txt")

0
templates/service/host/MyCompanyName.MyProjectName.Host/Properties/launchSettings.json → templates/service/host/MyCompanyName.MyProjectName.HttpApi.Host/Properties/launchSettings.json

4
templates/service/host/MyCompanyName.MyProjectName.Host/Startup.cs → templates/service/host/MyCompanyName.MyProjectName.HttpApi.Host/Startup.cs

@ -5,13 +5,13 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Volo.Abp;
namespace MyCompanyName.MyProjectName.Host
namespace MyCompanyName.MyProjectName
{
public class Startup
{
public IServiceProvider ConfigureServices(IServiceCollection services)
{
services.AddApplication<DemoAppModule>(options =>
services.AddApplication<MyProjectNameHttpApiHostModule>(options =>
{
options.UseAutofac();
});

12
templates/service/host/MyCompanyName.MyProjectName.HttpApi.Host/appsettings.json

@ -0,0 +1,12 @@
{
"ConnectionStrings": {
"Default": "Server=localhost;Database=MyProjectName_Identity;Trusted_Connection=True;MultipleActiveResultSets=true",
"MyProjectName": "Server=localhost;Database=MyProjectName_ModuleDb;Trusted_Connection=True;MultipleActiveResultSets=true"
},
"Redis": {
"Configuration": "127.0.0.1"
},
"AuthServer": {
"Authority": "http://localhost:61517"
}
}

0
templates/service/host/MyCompanyName.MyProjectName.Host/yarn.lock → templates/service/host/MyCompanyName.MyProjectName.HttpApi.Host/yarn.lock

Loading…
Cancel
Save