Browse Source

Merge branch 'dev' of https://github.com/abpframework/abp into dev

pull/1955/head
mehmet-erim 7 years ago
parent
commit
a4c3b9cfc3
  1. 2
      docs/en/Getting-Started-Angular-Template.md
  2. 1
      framework/src/Volo.Abp.AspNetCore.TestBase/Volo.Abp.AspNetCore.TestBase.csproj
  3. 33
      framework/src/Volo.Abp.AspNetCore.TestBase/Volo/Abp/AspNetCore/TestBase/AbpAspNetCoreIntegratedTestBase.cs
  4. 14
      framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/EfCoreDatabaseProvider.cs
  5. 5
      framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/MultiTenancy/AspNetCoreMultiTenancy_WithDomainResolver_Tests.cs
  6. 5
      framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/MultiTenancy/AspNetCoreMultiTenancy_Without_DomainResolver_Tests.cs
  7. 5
      framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AspNetCoreMvcTestBase.cs
  8. 3
      framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Json/JsonResultController_Tests.cs
  9. 3
      framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Json/JsonSerializer_Tests.cs
  10. 9
      framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Startup.cs
  11. 5
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/Demo/AbpAspNetCoreMvcUiBootstrapDemoTestBase.cs
  12. 9
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/Demo/TestStartup.cs
  13. 22
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Program.cs
  14. 7
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Startup.cs
  15. 2
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.csproj
  16. 10
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Tests/Volo/Abp/AspNetCore/Mvc/UI/Startup.cs
  17. 10
      framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/Startup.cs
  18. 9
      framework/test/Volo.Abp.AspNetCore.Tests/Volo/Abp/AspNetCore/Startup.cs
  19. 10
      framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/Startup.cs
  20. 15
      modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs
  21. 20
      modules/blogging/app/Volo.BloggingTestApp/Program.cs
  22. 12
      modules/blogging/app/Volo.BloggingTestApp/Startup.cs
  23. 4
      modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj
  24. 20
      modules/client-simulation/demo/Volo.ClientSimulation.Demo/Program.cs
  25. 9
      modules/client-simulation/demo/Volo.ClientSimulation.Demo/Startup.cs
  26. 2
      modules/client-simulation/demo/Volo.ClientSimulation.Demo/Volo.ClientSimulation.Demo.csproj
  27. 7
      modules/docs/app/VoloDocs.Web/Branding/VoloDocsBrandingProvider.cs
  28. 20
      modules/docs/app/VoloDocs.Web/Program.cs
  29. 11
      modules/docs/app/VoloDocs.Web/Startup.cs
  30. 4
      modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj
  31. 3
      modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs
  32. 2
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Grants/PersistedGrantConsts.cs
  33. 51
      modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs
  34. 3
      modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerModelBuilderConfigurationOptions.cs
  35. 4
      samples/BasicAspNetCoreApplication/BasicAspNetCoreApplication/BasicAspNetCoreApplication.csproj
  36. 2
      samples/BasicAspNetCoreApplication/BasicAspNetCoreApplication/Program.cs
  37. 9
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Domain/IdentityServer/IdentityServerDataSeedContributor.cs
  38. 6
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Acme.BookStore.HttpApi.Host.csproj
  39. 9
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/BookStoreHttpApiHostModule.cs
  40. 4
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Controllers/HomeController.cs
  41. 20
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Program.cs
  42. 9
      samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Startup.cs
  43. 10
      samples/BookStore-Modular/application/src/Acme.BookStore.Application.Contracts/Acme.BookStore.Application.Contracts.csproj
  44. 10
      samples/BookStore-Modular/application/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj
  45. 2
      samples/BookStore-Modular/application/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj
  46. 16
      samples/BookStore-Modular/application/src/Acme.BookStore.Domain.Shared/Acme.BookStore.Domain.Shared.csproj
  47. 18
      samples/BookStore-Modular/application/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj
  48. 9
      samples/BookStore-Modular/application/src/Acme.BookStore.Domain/IdentityServer/IdentityServerDataSeedContributor.cs
  49. 18
      samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore/Acme.BookStore.EntityFrameworkCore.csproj
  50. 10
      samples/BookStore-Modular/application/src/Acme.BookStore.HttpApi.Client/Acme.BookStore.HttpApi.Client.csproj
  51. 10
      samples/BookStore-Modular/application/src/Acme.BookStore.HttpApi/Acme.BookStore.HttpApi.csproj
  52. 20
      samples/BookStore-Modular/application/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj
  53. 9
      samples/BookStore-Modular/application/src/Acme.BookStore.Web/BookStoreWebModule.cs
  54. 20
      samples/BookStore-Modular/application/src/Acme.BookStore.Web/Program.cs
  55. 9
      samples/BookStore-Modular/application/src/Acme.BookStore.Web/Startup.cs
  56. 2
      samples/BookStore-Modular/application/test/Acme.BookStore.HttpApi.Client.ConsoleTestApp/Acme.BookStore.HttpApi.Client.ConsoleTestApp.csproj
  57. 6
      samples/BookStore-Modular/application/test/Acme.BookStore.TestBase/Acme.BookStore.TestBase.csproj
  58. 2
      samples/BookStore-Modular/application/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj
  59. 5
      samples/BookStore-Modular/application/test/Acme.BookStore.Web.Tests/BookStoreWebTestBase.cs
  60. 9
      samples/BookStore-Modular/application/test/Acme.BookStore.Web.Tests/BookStoreWebTestStartup.cs
  61. 18
      samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.HttpApi.Host/Acme.BookStore.BookManagement.HttpApi.Host.csproj
  62. 18
      samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.HttpApi.Host/BookManagementHttpApiHostModule.cs
  63. 5
      samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.HttpApi.Host/Controllers/HomeController.cs
  64. 20
      samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.HttpApi.Host/Program.cs
  65. 11
      samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.HttpApi.Host/Startup.cs
  66. 46
      samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Acme.BookStore.BookManagement.IdentityServer.csproj
  67. 16
      samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/BookManagementIdentityServerModule.cs
  68. 9
      samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/IdentityServer/IdentityServerDataSeedContributor.cs
  69. 20
      samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Program.cs
  70. 11
      samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Startup.cs
  71. 26
      samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/Acme.BookStore.BookManagement.Web.Host.csproj
  72. 14
      samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/BookManagementWebHostModule.cs
  73. 20
      samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/Program.cs
  74. 9
      samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/Startup.cs
  75. 36
      samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Acme.BookStore.BookManagement.Web.Unified.csproj
  76. 16
      samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/BookManagementWebUnifiedModule.cs
  77. 20
      samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Program.cs
  78. 11
      samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Startup.cs
  79. 4
      samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.Application.Contracts/Acme.BookStore.BookManagement.Application.Contracts.csproj
  80. 4
      samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.Application/Acme.BookStore.BookManagement.Application.csproj
  81. 4
      samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.Domain.Shared/Acme.BookStore.BookManagement.Domain.Shared.csproj
  82. 4
      samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.Domain/Acme.BookStore.BookManagement.Domain.csproj
  83. 4
      samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.EntityFrameworkCore/Acme.BookStore.BookManagement.EntityFrameworkCore.csproj
  84. 4
      samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.HttpApi.Client/Acme.BookStore.BookManagement.HttpApi.Client.csproj
  85. 4
      samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.HttpApi/Acme.BookStore.BookManagement.HttpApi.csproj
  86. 4
      samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.MongoDB/Acme.BookStore.BookManagement.MongoDB.csproj
  87. 6
      samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.Web/Acme.BookStore.BookManagement.Web.csproj
  88. 4
      samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.HttpApi.Client.ConsoleTestApp/Acme.BookStore.BookManagement.HttpApi.Client.ConsoleTestApp.csproj
  89. 37
      samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs
  90. 9
      samples/BookStore/src/Acme.BookStore.Application.Contracts/Acme.BookStore.Application.Contracts.csproj
  91. 9
      samples/BookStore/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj
  92. 2
      samples/BookStore/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj
  93. 16
      samples/BookStore/src/Acme.BookStore.Domain.Shared/Acme.BookStore.Domain.Shared.csproj
  94. 18
      samples/BookStore/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj
  95. 5
      samples/BookStore/src/Acme.BookStore.Domain/Book.cs
  96. 9
      samples/BookStore/src/Acme.BookStore.Domain/IdentityServer/IdentityServerDataSeedContributor.cs
  97. 18
      samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Acme.BookStore.EntityFrameworkCore.csproj
  98. 9
      samples/BookStore/src/Acme.BookStore.HttpApi.Client/Acme.BookStore.HttpApi.Client.csproj
  99. 9
      samples/BookStore/src/Acme.BookStore.HttpApi/Acme.BookStore.HttpApi.csproj
  100. 18
      samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj

2
docs/en/Getting-Started-Angular-Template.md

@ -75,7 +75,7 @@ Hit F5 (or Ctrl+F5) to run the application. It will have an output like shown be
#### Using EF Core Update-Database Command #### Using EF Core Update-Database Command
Ef Core has `Update-Database` command which creates database if necessary and applies pending migrations. Right click to the `.Web` project and select **Set as StartUp Project**: Ef Core has `Update-Database` command which creates database if necessary and applies pending migrations. Right click to the `.HttpApi.Host` project and select **Set as StartUp Project**:
![set-as-startup-project](images/set-as-startup-project.png) ![set-as-startup-project](images/set-as-startup-project.png)

1
framework/src/Volo.Abp.AspNetCore.TestBase/Volo.Abp.AspNetCore.TestBase.csproj

@ -19,6 +19,7 @@
<ProjectReference Include="..\Volo.Abp.AspNetCore\Volo.Abp.AspNetCore.csproj" /> <ProjectReference Include="..\Volo.Abp.AspNetCore\Volo.Abp.AspNetCore.csproj" />
<ProjectReference Include="..\Volo.Abp.Http.Client\Volo.Abp.Http.Client.csproj" /> <ProjectReference Include="..\Volo.Abp.Http.Client\Volo.Abp.Http.Client.csproj" />
<ProjectReference Include="..\Volo.Abp.TestBase\Volo.Abp.TestBase.csproj" /> <ProjectReference Include="..\Volo.Abp.TestBase\Volo.Abp.TestBase.csproj" />
<ProjectReference Include="..\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

33
framework/src/Volo.Abp.AspNetCore.TestBase/Volo/Abp/AspNetCore/TestBase/AbpAspNetCoreIntegratedTestBase.cs

@ -3,9 +3,11 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net.Http; using System.Net.Http;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Hosting.Server;
using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.TestHost; using Microsoft.AspNetCore.TestHost;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace Volo.Abp.AspNetCore.TestBase namespace Volo.Abp.AspNetCore.TestBase
{ {
@ -20,31 +22,36 @@ namespace Volo.Abp.AspNetCore.TestBase
protected AbpAspNetCoreIntegratedTestBase() protected AbpAspNetCoreIntegratedTestBase()
{ {
var builder = CreateWebHostBuilder(); var builder = CreateHostBuilder();
Server = CreateTestServer(builder);
Client = Server.CreateClient(); var host = builder.Build();
ServiceProvider = Server.Host.Services; host.Start();
Server = host.GetTestServer();
Client = host.GetTestClient();
ServiceProvider = Server.Services;
ServiceProvider.GetRequiredService<ITestServerAccessor>().Server = Server; ServiceProvider.GetRequiredService<ITestServerAccessor>().Server = Server;
} }
protected virtual IWebHostBuilder CreateWebHostBuilder() protected virtual IHostBuilder CreateHostBuilder()
{ {
return new WebHostBuilder() return Host.CreateDefaultBuilder()
.UseStartup<TStartup>() .ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<TStartup>();
webBuilder.UseTestServer();
})
.UseAutofac()
.ConfigureServices(ConfigureServices); .ConfigureServices(ConfigureServices);
} }
protected virtual void ConfigureServices(WebHostBuilderContext context, IServiceCollection services) protected virtual void ConfigureServices(HostBuilderContext context, IServiceCollection services)
{ {
} }
protected virtual TestServer CreateTestServer(IWebHostBuilder builder)
{
return new TestServer(builder);
}
#region GetUrl #region GetUrl
/// <summary> /// <summary>

14
framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/EfCoreDatabaseProvider.cs

@ -0,0 +1,14 @@
namespace Volo.Abp.EntityFrameworkCore
{
public enum EfCoreDatabaseProvider
{
SqlServer,
MySql,
Oracle,
PostgreSql,
Sqlite,
InMemory,
Cosmos,
Firebird
}
}

5
framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/MultiTenancy/AspNetCoreMultiTenancy_WithDomainResolver_Tests.cs

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Shouldly; using Shouldly;
using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy;
@ -23,9 +24,9 @@ namespace Volo.Abp.AspNetCore.MultiTenancy
_options = ServiceProvider.GetRequiredService<IOptions<AspNetCoreMultiTenancyOptions>>().Value; _options = ServiceProvider.GetRequiredService<IOptions<AspNetCoreMultiTenancyOptions>>().Value;
} }
protected override IWebHostBuilder CreateWebHostBuilder() protected override IHostBuilder CreateHostBuilder()
{ {
return base.CreateWebHostBuilder().ConfigureServices(services => return base.CreateHostBuilder().ConfigureServices(services =>
{ {
services.Configure<DefaultTenantStoreOptions>(options => services.Configure<DefaultTenantStoreOptions>(options =>
{ {

5
framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/MultiTenancy/AspNetCoreMultiTenancy_Without_DomainResolver_Tests.cs

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Microsoft.Net.Http.Headers; using Microsoft.Net.Http.Headers;
using Shouldly; using Shouldly;
@ -24,9 +25,9 @@ namespace Volo.Abp.AspNetCore.MultiTenancy
_options = ServiceProvider.GetRequiredService<IOptions<AspNetCoreMultiTenancyOptions>>().Value; _options = ServiceProvider.GetRequiredService<IOptions<AspNetCoreMultiTenancyOptions>>().Value;
} }
protected override IWebHostBuilder CreateWebHostBuilder() protected override IHostBuilder CreateHostBuilder()
{ {
return base.CreateWebHostBuilder().ConfigureServices(services => return base.CreateHostBuilder().ConfigureServices(services =>
{ {
services.Configure<DefaultTenantStoreOptions>(options => services.Configure<DefaultTenantStoreOptions>(options =>
{ {

5
framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AspNetCoreMvcTestBase.cs

@ -1,12 +1,13 @@
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
namespace Volo.Abp.AspNetCore.Mvc namespace Volo.Abp.AspNetCore.Mvc
{ {
public abstract class AspNetCoreMvcTestBase : AbpAspNetCoreTestBase<Startup> public abstract class AspNetCoreMvcTestBase : AbpAspNetCoreTestBase<Startup>
{ {
protected override IWebHostBuilder CreateWebHostBuilder() protected override IHostBuilder CreateHostBuilder()
{ {
var contentRootPath = CalculateContentRootPath( var contentRootPath = CalculateContentRootPath(
"Volo.Abp.AspNetCore.Mvc.Tests.csproj", "Volo.Abp.AspNetCore.Mvc.Tests.csproj",
@ -16,7 +17,7 @@ namespace Volo.Abp.AspNetCore.Mvc
) )
); );
return base.CreateWebHostBuilder() return base.CreateHostBuilder()
.UseContentRoot(contentRootPath); .UseContentRoot(contentRootPath);
} }

3
framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Json/JsonResultController_Tests.cs

@ -1,6 +1,7 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Shouldly; using Shouldly;
using Volo.Abp.Json; using Volo.Abp.Json;
using Xunit; using Xunit;
@ -9,7 +10,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Json
{ {
public class JsonResultController_Tests : AspNetCoreMvcTestBase public class JsonResultController_Tests : AspNetCoreMvcTestBase
{ {
protected override void ConfigureServices(WebHostBuilderContext context, IServiceCollection services) protected override void ConfigureServices(HostBuilderContext context, IServiceCollection services)
{ {
services.Configure<AbpJsonOptions>(options => services.Configure<AbpJsonOptions>(options =>
{ {

3
framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Json/JsonSerializer_Tests.cs

@ -1,6 +1,7 @@
using System; using System;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Shouldly; using Shouldly;
using Volo.Abp.Json; using Volo.Abp.Json;
using Xunit; using Xunit;
@ -16,7 +17,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Json
_jsonSerializer = ServiceProvider.GetRequiredService<IJsonSerializer>(); _jsonSerializer = ServiceProvider.GetRequiredService<IJsonSerializer>();
} }
protected override void ConfigureServices(WebHostBuilderContext context, IServiceCollection services) protected override void ConfigureServices(HostBuilderContext context, IServiceCollection services)
{ {
services.Configure<AbpJsonOptions>(options => services.Configure<AbpJsonOptions>(options =>
{ {

9
framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Startup.cs

@ -8,14 +8,9 @@ namespace Volo.Abp.AspNetCore.Mvc
{ {
public class Startup public class Startup
{ {
public IServiceProvider ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddApplication<AbpAspNetCoreMvcTestModule>(options => services.AddApplication<AbpAspNetCoreMvcTestModule>();
{
options.UseAutofac();
});
return services.BuildServiceProviderFromFactory();
} }
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)

5
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/Demo/AbpAspNetCoreMvcUiBootstrapDemoTestBase.cs

@ -2,14 +2,15 @@
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo
{ {
public abstract class AbpAspNetCoreMvcUiBootstrapDemoTestBase : AbpAspNetCoreTestBase<TestStartup> public abstract class AbpAspNetCoreMvcUiBootstrapDemoTestBase : AbpAspNetCoreTestBase<TestStartup>
{ {
protected override IWebHostBuilder CreateWebHostBuilder() protected override IHostBuilder CreateHostBuilder()
{ {
return base.CreateWebHostBuilder() return base.CreateHostBuilder()
.UseContentRoot(CalculateContentRootPath()); .UseContentRoot(CalculateContentRootPath());
} }

9
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/Demo/TestStartup.cs

@ -8,14 +8,9 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo
{ {
public class TestStartup public class TestStartup
{ {
public IServiceProvider ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddApplication<AbpAspNetCoreMvcUiBootstrapDemoTestModule>(options => services.AddApplication<AbpAspNetCoreMvcUiBootstrapDemoTestModule>();
{
options.UseAutofac();
});
return services.BuildServiceProviderFromFactory();
} }
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)

22
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Program.cs

@ -21,7 +21,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo
try try
{ {
Log.Information("Starting web host."); Log.Information("Starting web host.");
BuildWebHostInternal(args).Build().Run(); CreateHostBuilder(args).Build().Run();
return 0; return 0;
} }
catch (Exception ex) catch (Exception ex)
@ -35,20 +35,14 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo
} }
} }
//internal static IWebHost BuildWebHostInternal(string[] args) =>
// new WebHostBuilder()
// .UseKestrel()
// .UseContentRoot(Directory.GetCurrentDirectory())
// .UseIISIntegration()
// .UseStartup<Startup>()
// .UseSerilog()
// .Build();
internal static IHostBuilder BuildWebHostInternal(string[] args) => internal static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args) Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => .ConfigureWebHostDefaults(webBuilder =>
{ {
webBuilder.UseStartup<Startup>(); webBuilder.UseStartup<Startup>();
}); })
.UseAutofac()
.UseSerilog();
} }
} }

7
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Startup.cs

@ -9,12 +9,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo
{ {
public void ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddApplication<AbpAspNetCoreMvcUiBootstrapDemoModule>(options => services.AddApplication<AbpAspNetCoreMvcUiBootstrapDemoModule>();
{
options.UseAutofac();
});
//return services.BuildServiceProviderFromFactory();
} }
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)

2
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.csproj

@ -9,7 +9,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.0.0" /> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.0.0" />
<PackageReference Include="Serilog.AspNetCore" Version="2.1.1" /> <PackageReference Include="Serilog.Extensions.Hosting" Version="3.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" /> <PackageReference Include="Serilog.Sinks.File" Version="4.0.0" />
</ItemGroup> </ItemGroup>

10
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Tests/Volo/Abp/AspNetCore/Mvc/UI/Startup.cs

@ -8,15 +8,9 @@ namespace Volo.Abp.AspNetCore.Mvc.UI
{ {
public class Startup public class Startup
{ {
public IServiceProvider ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddApplication<AbpAspNetCoreMvcUiTestModule>(options => services.AddApplication<AbpAspNetCoreMvcUiTestModule>();
{
options.UseAutofac();
});
//TODO: This is needed because ASP.NET Core does not use IServiceProviderFactory!
return services.BuildServiceProviderFromFactory();
} }
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)

10
framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/Startup.cs

@ -8,15 +8,9 @@ namespace Volo.Abp.AspNetCore.Mvc.Versioning
{ {
public class Startup public class Startup
{ {
public IServiceProvider ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddApplication<AbpAspNetCoreMvcVersioningTestModule>(options => services.AddApplication<AbpAspNetCoreMvcVersioningTestModule>();
{
options.UseAutofac();
});
//TODO: This is needed because ASP.NET Core does not use IServiceProviderFactory!
return services.BuildServiceProviderFromFactory();
} }
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)

9
framework/test/Volo.Abp.AspNetCore.Tests/Volo/Abp/AspNetCore/Startup.cs

@ -8,14 +8,9 @@ namespace Volo.Abp.AspNetCore
{ {
public class Startup public class Startup
{ {
public IServiceProvider ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddApplication<AbpAspNetCoreTestModule>(options => services.AddApplication<AbpAspNetCoreTestModule>();
{
options.UseAutofac();
});
return services.BuildServiceProviderFromFactory();
} }
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)

10
framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/Startup.cs

@ -6,15 +6,9 @@ namespace Volo.Abp.Http
{ {
public class Startup public class Startup
{ {
public IServiceProvider ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddApplication<AbpHttpClientTestModule>(options => services.AddApplication<AbpHttpClientTestModule>();
{
options.UseAutofac();
});
//TODO: This is needed because ASP.NET Core does not use IServiceProviderFactory!
return services.BuildServiceProviderFromFactory();
} }
public void Configure(IApplicationBuilder app) public void Configure(IApplicationBuilder app)

15
modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs

@ -11,6 +11,7 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.Swagger; using Swashbuckle.AspNetCore.Swagger;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Account.Web; using Volo.Abp.Account.Web;
@ -59,7 +60,7 @@ namespace Volo.BloggingTestApp
public override void ConfigureServices(ServiceConfigurationContext context) public override void ConfigureServices(ServiceConfigurationContext context)
{ {
var hostingEnvironment = context.Services.GetHostingEnvironment(); var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.BuildConfiguration(); var configuration = context.Services.GetConfiguration();
Configure<BloggingUrlOptions>(options => Configure<BloggingUrlOptions>(options =>
{ {
@ -99,7 +100,7 @@ namespace Volo.BloggingTestApp
context.Services.AddSwaggerGen( context.Services.AddSwaggerGen(
options => options =>
{ {
options.SwaggerDoc("v1", new Info { Title = "Blogging API", Version = "v1" }); options.SwaggerDoc("v1", new OpenApiInfo { Title = "Blogging API", Version = "v1" });
options.DocInclusionPredicate((docName, description) => true); options.DocInclusionPredicate((docName, description) => true);
options.CustomSchemaIds(type => type.FullName); options.CustomSchemaIds(type => type.FullName);
}); });
@ -147,11 +148,11 @@ namespace Volo.BloggingTestApp
app.UseRouting(); app.UseRouting();
//app.UseSwagger(); app.UseSwagger();
//app.UseSwaggerUI(options => app.UseSwaggerUI(options =>
//{ {
// options.SwaggerEndpoint("/swagger/v1/swagger.json", "Support APP API"); options.SwaggerEndpoint("/swagger/v1/swagger.json", "Support APP API");
//}); });
app.UseAuthentication(); app.UseAuthentication();

20
modules/blogging/app/Volo.BloggingTestApp/Program.cs

@ -1,6 +1,7 @@
using System; using System;
using System.IO; using System.IO;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Serilog; using Serilog;
using Serilog.Events; using Serilog.Events;
@ -20,7 +21,7 @@ namespace Volo.BloggingTestApp
try try
{ {
Log.Information("Starting web host."); Log.Information("Starting web host.");
BuildWebHostInternal(args).Run(); CreateHostBuilder(args).Build().Run();
return 0; return 0;
} }
catch (Exception ex) catch (Exception ex)
@ -34,14 +35,13 @@ namespace Volo.BloggingTestApp
} }
} }
public static IWebHost BuildWebHostInternal(string[] args) => internal static IHostBuilder CreateHostBuilder(string[] args) =>
new WebHostBuilder() Host.CreateDefaultBuilder(args)
.UseKestrel() .ConfigureWebHostDefaults(webBuilder =>
.UseContentRoot(Directory.GetCurrentDirectory()) {
.UseIIS() webBuilder.UseStartup<Startup>();
.UseIISIntegration() })
.UseStartup<Startup>() .UseAutofac()
.UseSerilog() .UseSerilog();
.Build();
} }
} }

12
modules/blogging/app/Volo.BloggingTestApp/Startup.cs

@ -9,19 +9,13 @@ namespace Volo.BloggingTestApp
{ {
public class Startup public class Startup
{ {
public IServiceProvider ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddApplication<BloggingTestAppModule>(options => services.AddApplication<BloggingTestAppModule>();
{
options.UseAutofac();
});
return services.BuildServiceProviderFromFactory();
} }
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{ {
app.InitializeApplication(); app.InitializeApplication();
} }
} }

4
modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj

@ -12,9 +12,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="2.1.1" /> <PackageReference Include="Serilog.Extensions.Hosting" Version="3.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" /> <PackageReference Include="Serilog.Sinks.File" Version="4.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc4" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

20
modules/client-simulation/demo/Volo.ClientSimulation.Demo/Program.cs

@ -1,6 +1,7 @@
using System; using System;
using System.IO; using System.IO;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Serilog; using Serilog;
using Serilog.Events; using Serilog.Events;
@ -20,7 +21,7 @@ namespace Volo.ClientSimulation.Demo
try try
{ {
Log.Information("Starting web host."); Log.Information("Starting web host.");
BuildWebHostInternal(args).Run(); CreateHostBuilder(args).Build().Run();
return 0; return 0;
} }
catch (Exception ex) catch (Exception ex)
@ -34,14 +35,13 @@ namespace Volo.ClientSimulation.Demo
} }
} }
public static IWebHost BuildWebHostInternal(string[] args) => internal static IHostBuilder CreateHostBuilder(string[] args) =>
new WebHostBuilder() Host.CreateDefaultBuilder(args)
.UseKestrel() .ConfigureWebHostDefaults(webBuilder =>
.UseContentRoot(Directory.GetCurrentDirectory()) {
.UseIIS() webBuilder.UseStartup<Startup>();
.UseIISIntegration() })
.UseStartup<Startup>() .UseAutofac()
.UseSerilog() .UseSerilog();
.Build();
} }
} }

9
modules/client-simulation/demo/Volo.ClientSimulation.Demo/Startup.cs

@ -7,14 +7,9 @@ namespace Volo.ClientSimulation.Demo
{ {
public class Startup public class Startup
{ {
public IServiceProvider ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddApplication<ClientSimulationDemoModule>(options => services.AddApplication<ClientSimulationDemoModule>();
{
options.UseAutofac();
});
return services.BuildServiceProviderFromFactory();
} }
public void Configure(IApplicationBuilder app) public void Configure(IApplicationBuilder app)

2
modules/client-simulation/demo/Volo.ClientSimulation.Demo/Volo.ClientSimulation.Demo.csproj

@ -8,7 +8,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="2.1.1" /> <PackageReference Include="Serilog.Extensions.Hosting" Version="3.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" /> <PackageReference Include="Serilog.Sinks.File" Version="4.0.0" />
</ItemGroup> </ItemGroup>

7
modules/docs/app/VoloDocs.Web/Branding/VoloDocsBrandingProvider.cs

@ -1,4 +1,5 @@
using Microsoft.Extensions.Localization; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Components; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Components;
using Volo.Abp.Configuration; using Volo.Abp.Configuration;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
@ -9,10 +10,8 @@ namespace VoloDocs.Web.Branding
[Dependency(ReplaceServices = true)] [Dependency(ReplaceServices = true)]
public class VoloDocsBrandingProvider : DefaultBrandingProvider public class VoloDocsBrandingProvider : DefaultBrandingProvider
{ {
public VoloDocsBrandingProvider(IConfigurationAccessor configurationAccessor, IStringLocalizer<DocsResource> localizer) public VoloDocsBrandingProvider(IConfiguration configuration, IStringLocalizer<DocsResource> localizer)
{ {
var configuration = configurationAccessor.Configuration;
AppName = localizer["DocsTitle"]; AppName = localizer["DocsTitle"];
if (configuration["LogoUrl"] != null) if (configuration["LogoUrl"] != null)

20
modules/docs/app/VoloDocs.Web/Program.cs

@ -1,6 +1,7 @@
using System; using System;
using System.IO; using System.IO;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Serilog; using Serilog;
using Serilog.Events; using Serilog.Events;
@ -20,7 +21,7 @@ namespace VoloDocs.Web
try try
{ {
Log.Information("Starting web host."); Log.Information("Starting web host.");
BuildWebHostInternal(args).Run(); CreateHostBuilder(args).Build().Run();
return 0; return 0;
} }
catch (Exception ex) catch (Exception ex)
@ -34,14 +35,13 @@ namespace VoloDocs.Web
} }
} }
public static IWebHost BuildWebHostInternal(string[] args) => internal static IHostBuilder CreateHostBuilder(string[] args) =>
new WebHostBuilder() Host.CreateDefaultBuilder(args)
.UseKestrel() .ConfigureWebHostDefaults(webBuilder =>
.UseContentRoot(Directory.GetCurrentDirectory()) {
.UseIIS() webBuilder.UseStartup<Startup>();
.UseIISIntegration() })
.UseStartup<Startup>() .UseAutofac()
.UseSerilog() .UseSerilog();
.Build();
} }
} }

11
modules/docs/app/VoloDocs.Web/Startup.cs

@ -9,17 +9,12 @@ namespace VoloDocs.Web
{ {
public class Startup public class Startup
{ {
public IServiceProvider ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddApplication<VoloDocsWebModule>(options => services.AddApplication<VoloDocsWebModule>();
{
options.UseAutofac();
});
return services.BuildServiceProviderFromFactory();
} }
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{ {
app.InitializeApplication(); app.InitializeApplication();
} }

4
modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj

@ -14,9 +14,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="2.1.1" /> <PackageReference Include="Serilog.Extensions.Hosting" Version="3.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" /> <PackageReference Include="Serilog.Sinks.File" Version="4.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc4" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

3
modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs

@ -2,6 +2,7 @@
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.Swagger; using Swashbuckle.AspNetCore.Swagger;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Account.Web; using Volo.Abp.Account.Web;
@ -96,7 +97,7 @@ namespace VoloDocs.Web
context.Services.AddSwaggerGen( context.Services.AddSwaggerGen(
options => options =>
{ {
options.SwaggerDoc("v1", new Info options.SwaggerDoc("v1", new OpenApiInfo
{ {
Title = "Docs API", Title = "Docs API",
Version = "v1" Version = "v1"

2
modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Grants/PersistedGrantConsts.cs

@ -9,6 +9,6 @@
// 50000 chosen to be explicit to allow enough size to avoid truncation, yet stay beneath the MySql row size limit of ~65K // 50000 chosen to be explicit to allow enough size to avoid truncation, yet stay beneath the MySql row size limit of ~65K
// apparently anything over 4K converts to nvarchar(max) on SqlServer // apparently anything over 4K converts to nvarchar(max) on SqlServer
public const int DataMaxLength = 5000; public const int DataMaxLength = 50000;
} }
} }

51
modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs

@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json; using Newtonsoft.Json;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Modeling; using Volo.Abp.EntityFrameworkCore.Modeling;
using Volo.Abp.IdentityServer.ApiResources; using Volo.Abp.IdentityServer.ApiResources;
using Volo.Abp.IdentityServer.Clients; using Volo.Abp.IdentityServer.Clients;
@ -71,7 +72,14 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
redirectUri.HasKey(x => new { x.ClientId, x.RedirectUri }); redirectUri.HasKey(x => new { x.ClientId, x.RedirectUri });
redirectUri.Property(x => x.RedirectUri).HasMaxLength(ClientRedirectUriConsts.RedirectUriMaxLength).IsRequired(); if (options.DatabaseProvider == EfCoreDatabaseProvider.MySql)
{
redirectUri.Property(x => x.RedirectUri).HasMaxLength(300).IsRequired();
}
else
{
redirectUri.Property(x => x.RedirectUri).HasMaxLength(ClientRedirectUriConsts.RedirectUriMaxLength).IsRequired();
}
}); });
builder.Entity<ClientPostLogoutRedirectUri>(postLogoutRedirectUri => builder.Entity<ClientPostLogoutRedirectUri>(postLogoutRedirectUri =>
@ -80,7 +88,14 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
postLogoutRedirectUri.HasKey(x => new { x.ClientId, x.PostLogoutRedirectUri }); postLogoutRedirectUri.HasKey(x => new { x.ClientId, x.PostLogoutRedirectUri });
postLogoutRedirectUri.Property(x => x.PostLogoutRedirectUri).HasMaxLength(ClientPostLogoutRedirectUriConsts.PostLogoutRedirectUriMaxLength).IsRequired(); if (options.DatabaseProvider == EfCoreDatabaseProvider.MySql)
{
postLogoutRedirectUri.Property(x => x.PostLogoutRedirectUri).HasMaxLength(300).IsRequired();
}
else
{
postLogoutRedirectUri.Property(x => x.PostLogoutRedirectUri).HasMaxLength(ClientPostLogoutRedirectUriConsts.PostLogoutRedirectUriMaxLength).IsRequired();
}
}); });
builder.Entity<ClientScope>(scope => builder.Entity<ClientScope>(scope =>
@ -99,7 +114,16 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
secret.HasKey(x => new { x.ClientId, x.Type, x.Value }); secret.HasKey(x => new { x.ClientId, x.Type, x.Value });
secret.Property(x => x.Type).HasMaxLength(SecretConsts.TypeMaxLength).IsRequired(); secret.Property(x => x.Type).HasMaxLength(SecretConsts.TypeMaxLength).IsRequired();
secret.Property(x => x.Value).HasMaxLength(SecretConsts.ValueMaxLength).IsRequired();
if (options.DatabaseProvider == EfCoreDatabaseProvider.MySql)
{
secret.Property(x => x.Value).HasMaxLength(300).IsRequired();
}
else
{
secret.Property(x => x.Value).HasMaxLength(SecretConsts.ValueMaxLength).IsRequired();
}
secret.Property(x => x.Description).HasMaxLength(SecretConsts.DescriptionMaxLength); secret.Property(x => x.Description).HasMaxLength(SecretConsts.DescriptionMaxLength);
}); });
@ -152,7 +176,15 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
grant.Property(x => x.SubjectId).HasMaxLength(PersistedGrantConsts.SubjectIdMaxLength); grant.Property(x => x.SubjectId).HasMaxLength(PersistedGrantConsts.SubjectIdMaxLength);
grant.Property(x => x.ClientId).HasMaxLength(PersistedGrantConsts.ClientIdMaxLength).IsRequired(); grant.Property(x => x.ClientId).HasMaxLength(PersistedGrantConsts.ClientIdMaxLength).IsRequired();
grant.Property(x => x.CreationTime).IsRequired(); grant.Property(x => x.CreationTime).IsRequired();
grant.Property(x => x.Data).HasMaxLength(PersistedGrantConsts.DataMaxLength).IsRequired();
if (options.DatabaseProvider == EfCoreDatabaseProvider.MySql)
{
grant.Property(x => x.Data).HasMaxLength(10000).IsRequired();
}
else
{
grant.Property(x => x.Data).HasMaxLength(PersistedGrantConsts.DataMaxLength).IsRequired();
}
grant.HasKey(x => x.Key); //TODO: What about Id!!! grant.HasKey(x => x.Key); //TODO: What about Id!!!
@ -214,7 +246,16 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
apiSecret.HasKey(x => new { x.ApiResourceId, x.Type, x.Value }); apiSecret.HasKey(x => new { x.ApiResourceId, x.Type, x.Value });
apiSecret.Property(x => x.Type).HasMaxLength(SecretConsts.TypeMaxLength).IsRequired(); apiSecret.Property(x => x.Type).HasMaxLength(SecretConsts.TypeMaxLength).IsRequired();
apiSecret.Property(x => x.Value).HasMaxLength(SecretConsts.ValueMaxLength).IsRequired();
if (options.DatabaseProvider == EfCoreDatabaseProvider.MySql)
{
apiSecret.Property(x => x.Value).HasMaxLength(300).IsRequired();
}
else
{
apiSecret.Property(x => x.Value).HasMaxLength(SecretConsts.ValueMaxLength).IsRequired();
}
apiSecret.Property(x => x.Description).HasMaxLength(SecretConsts.DescriptionMaxLength); apiSecret.Property(x => x.Description).HasMaxLength(SecretConsts.DescriptionMaxLength);
}); });

3
modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerModelBuilderConfigurationOptions.cs

@ -1,10 +1,13 @@
using JetBrains.Annotations; using JetBrains.Annotations;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Modeling; using Volo.Abp.EntityFrameworkCore.Modeling;
namespace Volo.Abp.IdentityServer.EntityFrameworkCore namespace Volo.Abp.IdentityServer.EntityFrameworkCore
{ {
public class IdentityServerModelBuilderConfigurationOptions : ModelBuilderConfigurationOptions public class IdentityServerModelBuilderConfigurationOptions : ModelBuilderConfigurationOptions
{ {
public EfCoreDatabaseProvider? DatabaseProvider { get; set; }
public IdentityServerModelBuilderConfigurationOptions( public IdentityServerModelBuilderConfigurationOptions(
[NotNull] string tablePrefix, [NotNull] string tablePrefix,
[CanBeNull] string schema) [CanBeNull] string schema)

4
samples/BasicAspNetCoreApplication/BasicAspNetCoreApplication/BasicAspNetCoreApplication.csproj

@ -5,8 +5,8 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="0.22.0" /> <ProjectReference Include="..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<PackageReference Include="Volo.Abp.Autofac" Version="0.22.0" /> <ProjectReference Include="..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc\Volo.Abp.AspNetCore.Mvc.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

2
samples/BasicAspNetCoreApplication/BasicAspNetCoreApplication/Program.cs

@ -10,7 +10,7 @@ namespace BasicAspNetCoreApplication
CreateHostBuilder(args).Build().Run(); CreateHostBuilder(args).Build().Run();
} }
public static IHostBuilder CreateHostBuilder(string[] args) => internal static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args) Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => .ConfigureWebHostDefaults(webBuilder =>
{ {

9
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Domain/IdentityServer/IdentityServerDataSeedContributor.cs

@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using IdentityServer4.Models; using IdentityServer4.Models;
using Microsoft.Extensions.Configuration;
using Volo.Abp.Authorization.Permissions; using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Configuration; using Volo.Abp.Configuration;
using Volo.Abp.Data; using Volo.Abp.Data;
@ -24,7 +25,7 @@ namespace Acme.BookStore.IdentityServer
private readonly IIdentityResourceDataSeeder _identityResourceDataSeeder; private readonly IIdentityResourceDataSeeder _identityResourceDataSeeder;
private readonly IGuidGenerator _guidGenerator; private readonly IGuidGenerator _guidGenerator;
private readonly IPermissionDataSeeder _permissionDataSeeder; private readonly IPermissionDataSeeder _permissionDataSeeder;
private readonly IConfigurationAccessor _configurationAccessor; private readonly IConfiguration _configuration;
public IdentityServerDataSeedContributor( public IdentityServerDataSeedContributor(
IClientRepository clientRepository, IClientRepository clientRepository,
@ -32,14 +33,14 @@ namespace Acme.BookStore.IdentityServer
IIdentityResourceDataSeeder identityResourceDataSeeder, IIdentityResourceDataSeeder identityResourceDataSeeder,
IGuidGenerator guidGenerator, IGuidGenerator guidGenerator,
IPermissionDataSeeder permissionDataSeeder, IPermissionDataSeeder permissionDataSeeder,
IConfigurationAccessor configurationAccessor) IConfiguration configuration)
{ {
_clientRepository = clientRepository; _clientRepository = clientRepository;
_apiResourceRepository = apiResourceRepository; _apiResourceRepository = apiResourceRepository;
_identityResourceDataSeeder = identityResourceDataSeeder; _identityResourceDataSeeder = identityResourceDataSeeder;
_guidGenerator = guidGenerator; _guidGenerator = guidGenerator;
_permissionDataSeeder = permissionDataSeeder; _permissionDataSeeder = permissionDataSeeder;
_configurationAccessor = configurationAccessor; _configuration = configuration;
} }
[UnitOfWork] [UnitOfWork]
@ -104,7 +105,7 @@ namespace Acme.BookStore.IdentityServer
"BookStore" "BookStore"
}; };
var configurationSection = _configurationAccessor.Configuration.GetSection("IdentityServer:Clients"); var configurationSection = _configuration.GetSection("IdentityServer:Clients");
//Web Client //Web Client
var webClientId = configurationSection["BookStore_Web:ClientId"]; var webClientId = configurationSection["BookStore_Web:ClientId"];

6
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Acme.BookStore.HttpApi.Host.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\common.props" /> <Import Project="..\..\common.props" />
@ -10,10 +10,10 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="2.1.1" /> <PackageReference Include="Serilog.Extensions.Hosting" Version="3.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" /> <PackageReference Include="Serilog.Sinks.File" Version="4.0.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" /> <PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc4" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.0" /> <PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.MultiTenancy\Volo.Abp.AspNetCore.MultiTenancy.csproj" /> <ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.MultiTenancy\Volo.Abp.AspNetCore.MultiTenancy.csproj" />

9
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/BookStoreHttpApiHostModule.cs

@ -11,6 +11,7 @@ using Microsoft.Extensions.Hosting;
using Acme.BookStore.MongoDB; using Acme.BookStore.MongoDB;
using Acme.BookStore.MultiTenancy; using Acme.BookStore.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.Swagger; using Swashbuckle.AspNetCore.Swagger;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Account.Web; using Volo.Abp.Account.Web;
@ -50,9 +51,7 @@ namespace Acme.BookStore
ConfigureLocalization(); ConfigureLocalization();
ConfigureVirtualFileSystem(context); ConfigureVirtualFileSystem(context);
ConfigureCors(context, configuration); ConfigureCors(context, configuration);
ConfigureSwaggerServices(context);
//Disabled swagger since it does not support ASP.NET Core 3.0 yet!
//ConfigureSwaggerServices(context);
} }
private void ConfigureUrls(IConfigurationRoot configuration) private void ConfigureUrls(IConfigurationRoot configuration)
@ -107,7 +106,7 @@ namespace Acme.BookStore
context.Services.AddSwaggerGen( context.Services.AddSwaggerGen(
options => options =>
{ {
options.SwaggerDoc("v1", new Info {Title = "BookStore API", Version = "v1"}); options.SwaggerDoc("v1", new OpenApiInfo {Title = "BookStore API", Version = "v1"});
options.DocInclusionPredicate((docName, description) => true); options.DocInclusionPredicate((docName, description) => true);
}); });
} }
@ -166,13 +165,11 @@ namespace Acme.BookStore
app.UseIdentityServer(); app.UseIdentityServer();
app.UseAbpRequestLocalization(); app.UseAbpRequestLocalization();
/* Disabled swagger since it does not support ASP.NET Core 3.0 yet!
app.UseSwagger(); app.UseSwagger();
app.UseSwaggerUI(options => app.UseSwaggerUI(options =>
{ {
options.SwaggerEndpoint("/swagger/v1/swagger.json", "BookStore API"); options.SwaggerEndpoint("/swagger/v1/swagger.json", "BookStore API");
}); });
*/
app.UseAuditing(); app.UseAuditing();
app.UseMvcWithDefaultRouteAndArea(); app.UseMvcWithDefaultRouteAndArea();

4
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Controllers/HomeController.cs

@ -7,9 +7,7 @@ namespace Acme.BookStore.Controllers
{ {
public ActionResult Index() public ActionResult Index()
{ {
//TODO: Enabled once Swagger supports ASP.NET Core 3.x return Redirect("/swagger");
//return Redirect("/swagger");
return Content("OK: Acme.BookStore.HttpApi.Host is running...");
} }
} }
} }

20
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Program.cs

@ -1,6 +1,7 @@
using System; using System;
using System.IO; using System.IO;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Serilog; using Serilog;
using Serilog.Events; using Serilog.Events;
@ -24,7 +25,7 @@ namespace Acme.BookStore
try try
{ {
Log.Information("Starting Acme.BookStore.HttpApi.Host."); Log.Information("Starting Acme.BookStore.HttpApi.Host.");
BuildWebHostInternal(args).Run(); CreateHostBuilder(args).Build().Run();
return 0; return 0;
} }
catch (Exception ex) catch (Exception ex)
@ -38,14 +39,13 @@ namespace Acme.BookStore
} }
} }
public static IWebHost BuildWebHostInternal(string[] args) => internal static IHostBuilder CreateHostBuilder(string[] args) =>
new WebHostBuilder() Host.CreateDefaultBuilder(args)
.UseKestrel() .ConfigureWebHostDefaults(webBuilder =>
.UseContentRoot(Directory.GetCurrentDirectory()) {
.UseIIS() webBuilder.UseStartup<Startup>();
.UseIISIntegration() })
.UseStartup<Startup>() .UseAutofac()
.UseSerilog() .UseSerilog();
.Build();
} }
} }

9
samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.HttpApi.Host/Startup.cs

@ -9,14 +9,9 @@ namespace Acme.BookStore
{ {
public class Startup public class Startup
{ {
public IServiceProvider ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddApplication<BookStoreHttpApiHostModule>(options => services.AddApplication<BookStoreHttpApiHostModule>();
{
options.UseAutofac();
});
return services.BuildServiceProviderFromFactory();
} }
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)

10
samples/BookStore-Modular/application/src/Acme.BookStore.Application.Contracts/Acme.BookStore.Application.Contracts.csproj

@ -12,11 +12,11 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Account.Application.Contracts" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\account\src\Volo.Abp.Account.Application.Contracts\Volo.Abp.Account.Application.Contracts.csproj" />
<PackageReference Include="Volo.Abp.Identity.Application.Contracts" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Application.Contracts\Volo.Abp.Identity.Application.Contracts.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application.Contracts" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.Application.Contracts\Volo.Abp.PermissionManagement.Application.Contracts.csproj" />
<PackageReference Include="Volo.Abp.TenantManagement.Application.Contracts" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Application.Contracts\Volo.Abp.TenantManagement.Application.Contracts.csproj" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application.Contracts" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Application.Contracts\Volo.Abp.FeatureManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\..\..\modules\book-management\src\Acme.BookStore.BookManagement.Application.Contracts\Acme.BookStore.BookManagement.Application.Contracts.csproj" /> <ProjectReference Include="..\..\..\modules\book-management\src\Acme.BookStore.BookManagement.Application.Contracts\Acme.BookStore.BookManagement.Application.Contracts.csproj" />
</ItemGroup> </ItemGroup>

10
samples/BookStore-Modular/application/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj

@ -13,11 +13,11 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Account.Application" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\account\src\Volo.Abp.Account.Application\Volo.Abp.Account.Application.csproj" />
<PackageReference Include="Volo.Abp.Identity.Application" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Application\Volo.Abp.Identity.Application.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.Application\Volo.Abp.PermissionManagement.Application.csproj" />
<PackageReference Include="Volo.Abp.TenantManagement.Application" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Application\Volo.Abp.TenantManagement.Application.csproj" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Application\Volo.Abp.FeatureManagement.Application.csproj" />
<ProjectReference Include="..\..\..\modules\book-management\src\Acme.BookStore.BookManagement.Application\Acme.BookStore.BookManagement.Application.csproj" /> <ProjectReference Include="..\..\..\modules\book-management\src\Acme.BookStore.BookManagement.Application\Acme.BookStore.BookManagement.Application.csproj" />
</ItemGroup> </ItemGroup>

2
samples/BookStore-Modular/application/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj

@ -26,7 +26,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Autofac" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\Acme.BookStore.Application.Contracts\Acme.BookStore.Application.Contracts.csproj" /> <ProjectReference Include="..\Acme.BookStore.Application.Contracts\Acme.BookStore.Application.Contracts.csproj" />
<ProjectReference Include="..\Acme.BookStore.EntityFrameworkCore.DbMigrations\Acme.BookStore.EntityFrameworkCore.DbMigrations.csproj" /> <ProjectReference Include="..\Acme.BookStore.EntityFrameworkCore.DbMigrations\Acme.BookStore.EntityFrameworkCore.DbMigrations.csproj" />
</ItemGroup> </ItemGroup>

16
samples/BookStore-Modular/application/src/Acme.BookStore.Domain.Shared/Acme.BookStore.Domain.Shared.csproj

@ -8,14 +8,14 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Identity.Domain.Shared" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Domain.Shared\Volo.Abp.Identity.Domain.Shared.csproj" />
<PackageReference Include="Volo.Abp.IdentityServer.Domain.Shared" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\identityserver\src\Volo.Abp.IdentityServer.Domain.Shared\Volo.Abp.IdentityServer.Domain.Shared.csproj" />
<PackageReference Include="Volo.Abp.BackgroundJobs.Domain.Shared" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\background-jobs\src\Volo.Abp.BackgroundJobs.Domain.Shared\Volo.Abp.BackgroundJobs.Domain.Shared.csproj" />
<PackageReference Include="Volo.Abp.AuditLogging.Domain.Shared" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.Domain.Shared\Volo.Abp.AuditLogging.Domain.Shared.csproj" />
<PackageReference Include="Volo.Abp.TenantManagement.Domain.Shared" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Domain.Shared\Volo.Abp.TenantManagement.Domain.Shared.csproj" />
<PackageReference Include="Volo.Abp.FeatureManagement.Domain.Shared" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Domain.Shared\Volo.Abp.FeatureManagement.Domain.Shared.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Shared" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.Domain.Shared\Volo.Abp.PermissionManagement.Domain.Shared.csproj" />
<PackageReference Include="Volo.Abp.SettingManagement.Domain.Shared" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.Domain.Shared\Volo.Abp.SettingManagement.Domain.Shared.csproj" />
<ProjectReference Include="..\..\..\modules\book-management\src\Acme.BookStore.BookManagement.Domain.Shared\Acme.BookStore.BookManagement.Domain.Shared.csproj" /> <ProjectReference Include="..\..\..\modules\book-management\src\Acme.BookStore.BookManagement.Domain.Shared\Acme.BookStore.BookManagement.Domain.Shared.csproj" />
</ItemGroup> </ItemGroup>

18
samples/BookStore-Modular/application/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj

@ -13,15 +13,15 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.DataAnnotations" Version="2.2.0" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.DataAnnotations" Version="2.2.0" />
<PackageReference Include="Volo.Abp.Identity.Domain" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Domain\Volo.Abp.Identity.Domain.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Identity" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\identity\src\Volo.Abp.PermissionManagement.Domain.Identity\Volo.Abp.PermissionManagement.Domain.Identity.csproj" />
<PackageReference Include="Volo.Abp.IdentityServer.Domain" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\identityserver\src\Volo.Abp.IdentityServer.Domain\Volo.Abp.IdentityServer.Domain.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.IdentityServer" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\identityserver\src\Volo.Abp.PermissionManagement.Domain.IdentityServer\Volo.Abp.PermissionManagement.Domain.IdentityServer.csproj" />
<PackageReference Include="Volo.Abp.BackgroundJobs.Domain" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\background-jobs\src\Volo.Abp.BackgroundJobs.Domain\Volo.Abp.BackgroundJobs.Domain.csproj" />
<PackageReference Include="Volo.Abp.AuditLogging.Domain" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.Domain\Volo.Abp.AuditLogging.Domain.csproj" />
<PackageReference Include="Volo.Abp.TenantManagement.Domain" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Domain\Volo.Abp.TenantManagement.Domain.csproj" />
<PackageReference Include="Volo.Abp.FeatureManagement.Domain" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Domain\Volo.Abp.FeatureManagement.Domain.csproj" />
<PackageReference Include="Volo.Abp.SettingManagement.Domain" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.Domain\Volo.Abp.SettingManagement.Domain.csproj" />
<ProjectReference Include="..\..\..\modules\book-management\src\Acme.BookStore.BookManagement.Domain\Acme.BookStore.BookManagement.Domain.csproj" /> <ProjectReference Include="..\..\..\modules\book-management\src\Acme.BookStore.BookManagement.Domain\Acme.BookStore.BookManagement.Domain.csproj" />
</ItemGroup> </ItemGroup>

9
samples/BookStore-Modular/application/src/Acme.BookStore.Domain/IdentityServer/IdentityServerDataSeedContributor.cs

@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using IdentityServer4.Models; using IdentityServer4.Models;
using Microsoft.Extensions.Configuration;
using Volo.Abp.Authorization.Permissions; using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Configuration; using Volo.Abp.Configuration;
using Volo.Abp.Data; using Volo.Abp.Data;
@ -24,7 +25,7 @@ namespace Acme.BookStore.IdentityServer
private readonly IIdentityResourceDataSeeder _identityResourceDataSeeder; private readonly IIdentityResourceDataSeeder _identityResourceDataSeeder;
private readonly IGuidGenerator _guidGenerator; private readonly IGuidGenerator _guidGenerator;
private readonly IPermissionDataSeeder _permissionDataSeeder; private readonly IPermissionDataSeeder _permissionDataSeeder;
private readonly IConfigurationAccessor _configurationAccessor; private readonly IConfiguration _configuration;
public IdentityServerDataSeedContributor( public IdentityServerDataSeedContributor(
IClientRepository clientRepository, IClientRepository clientRepository,
@ -32,14 +33,14 @@ namespace Acme.BookStore.IdentityServer
IIdentityResourceDataSeeder identityResourceDataSeeder, IIdentityResourceDataSeeder identityResourceDataSeeder,
IGuidGenerator guidGenerator, IGuidGenerator guidGenerator,
IPermissionDataSeeder permissionDataSeeder, IPermissionDataSeeder permissionDataSeeder,
IConfigurationAccessor configurationAccessor) IConfiguration configuration)
{ {
_clientRepository = clientRepository; _clientRepository = clientRepository;
_apiResourceRepository = apiResourceRepository; _apiResourceRepository = apiResourceRepository;
_identityResourceDataSeeder = identityResourceDataSeeder; _identityResourceDataSeeder = identityResourceDataSeeder;
_guidGenerator = guidGenerator; _guidGenerator = guidGenerator;
_permissionDataSeeder = permissionDataSeeder; _permissionDataSeeder = permissionDataSeeder;
_configurationAccessor = configurationAccessor; _configuration = configuration;
} }
[UnitOfWork] [UnitOfWork]
@ -104,7 +105,7 @@ namespace Acme.BookStore.IdentityServer
"BookStore" "BookStore"
}; };
var configurationSection = _configurationAccessor.Configuration.GetSection("IdentityServer:Clients"); var configurationSection = _configuration.GetSection("IdentityServer:Clients");
//Web Client //Web Client
var webClientId = configurationSection["BookStore_Web:ClientId"]; var webClientId = configurationSection["BookStore_Web:ClientId"];

18
samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore/Acme.BookStore.EntityFrameworkCore.csproj

@ -9,15 +9,15 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Acme.BookStore.Domain\Acme.BookStore.Domain.csproj" /> <ProjectReference Include="..\Acme.BookStore.Domain\Acme.BookStore.Domain.csproj" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.EntityFrameworkCore.SqlServer\Volo.Abp.EntityFrameworkCore.SqlServer.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.EntityFrameworkCore\Volo.Abp.PermissionManagement.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.EntityFrameworkCore\Volo.Abp.SettingManagement.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.Identity.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.EntityFrameworkCore\Volo.Abp.Identity.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.IdentityServer.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\identityserver\src\Volo.Abp.IdentityServer.EntityFrameworkCore\Volo.Abp.IdentityServer.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.BackgroundJobs.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\background-jobs\src\Volo.Abp.BackgroundJobs.EntityFrameworkCore\Volo.Abp.BackgroundJobs.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.AuditLogging.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.EntityFrameworkCore\Volo.Abp.AuditLogging.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.TenantManagement.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.EntityFrameworkCore\Volo.Abp.TenantManagement.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.FeatureManagement.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.EntityFrameworkCore\Volo.Abp.FeatureManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\modules\book-management\src\Acme.BookStore.BookManagement.EntityFrameworkCore\Acme.BookStore.BookManagement.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\..\modules\book-management\src\Acme.BookStore.BookManagement.EntityFrameworkCore\Acme.BookStore.BookManagement.EntityFrameworkCore.csproj" />
</ItemGroup> </ItemGroup>

10
samples/BookStore-Modular/application/src/Acme.BookStore.HttpApi.Client/Acme.BookStore.HttpApi.Client.csproj

@ -13,11 +13,11 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Account.HttpApi.Client" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\account\src\Volo.Abp.Account.HttpApi.Client\Volo.Abp.Account.HttpApi.Client.csproj" />
<PackageReference Include="Volo.Abp.Identity.HttpApi.Client" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.HttpApi.Client\Volo.Abp.Identity.HttpApi.Client.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi.Client" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.HttpApi.Client\Volo.Abp.PermissionManagement.HttpApi.Client.csproj" />
<PackageReference Include="Volo.Abp.TenantManagement.HttpApi.Client" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.HttpApi.Client\Volo.Abp.TenantManagement.HttpApi.Client.csproj" />
<PackageReference Include="Volo.Abp.FeatureManagement.HttpApi.Client" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.HttpApi.Client\Volo.Abp.FeatureManagement.HttpApi.Client.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

10
samples/BookStore-Modular/application/src/Acme.BookStore.HttpApi/Acme.BookStore.HttpApi.csproj

@ -13,11 +13,11 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Account.HttpApi" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\account\src\Volo.Abp.Account.HttpApi\Volo.Abp.Account.HttpApi.csproj" />
<PackageReference Include="Volo.Abp.Identity.HttpApi" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.HttpApi\Volo.Abp.Identity.HttpApi.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.HttpApi\Volo.Abp.PermissionManagement.HttpApi.csproj" />
<PackageReference Include="Volo.Abp.TenantManagement.HttpApi" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.HttpApi\Volo.Abp.TenantManagement.HttpApi.csproj" />
<PackageReference Include="Volo.Abp.FeatureManagement.HttpApi" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.HttpApi\Volo.Abp.FeatureManagement.HttpApi.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

20
samples/BookStore-Modular/application/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\common.props" /> <Import Project="..\..\common.props" />
@ -32,10 +32,10 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="2.1.1" /> <PackageReference Include="Serilog.Extensions.Hosting" Version="3.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" /> <PackageReference Include="Serilog.Sinks.File" Version="4.0.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" /> <PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc4" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.0" /> <PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0" />
</ItemGroup> </ItemGroup>
@ -45,13 +45,13 @@
<ProjectReference Include="..\Acme.BookStore.Application\Acme.BookStore.Application.csproj" /> <ProjectReference Include="..\Acme.BookStore.Application\Acme.BookStore.Application.csproj" />
<ProjectReference Include="..\Acme.BookStore.HttpApi\Acme.BookStore.HttpApi.csproj" /> <ProjectReference Include="..\Acme.BookStore.HttpApi\Acme.BookStore.HttpApi.csproj" />
<ProjectReference Include="..\Acme.BookStore.EntityFrameworkCore.DbMigrations\Acme.BookStore.EntityFrameworkCore.DbMigrations.csproj" /> <ProjectReference Include="..\Acme.BookStore.EntityFrameworkCore.DbMigrations\Acme.BookStore.EntityFrameworkCore.DbMigrations.csproj" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
<PackageReference Include="Volo.Abp.Autofac" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Authentication.JwtBearer\Volo.Abp.AspNetCore.Authentication.JwtBearer.csproj" />
<PackageReference Include="Volo.Abp.Identity.Web" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Web\Volo.Abp.Identity.Web.csproj" />
<PackageReference Include="Volo.Abp.Account.Web.IdentityServer" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\account\src\Volo.Abp.Account.Web.IdentityServer\Volo.Abp.Account.Web.IdentityServer.csproj" />
<PackageReference Include="Volo.Abp.TenantManagement.Web" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Web\Volo.Abp.TenantManagement.Web.csproj" />
<PackageReference Include="Volo.Abp.FeatureManagement.Web" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Web\Volo.Abp.FeatureManagement.Web.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

9
samples/BookStore-Modular/application/src/Acme.BookStore.Web/BookStoreWebModule.cs

@ -11,6 +11,7 @@ using Acme.BookStore.EntityFrameworkCore;
using Acme.BookStore.Localization; using Acme.BookStore.Localization;
using Acme.BookStore.MultiTenancy; using Acme.BookStore.MultiTenancy;
using Acme.BookStore.Web.Menus; using Acme.BookStore.Web.Menus;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.Swagger; using Swashbuckle.AspNetCore.Swagger;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Account.Web; using Volo.Abp.Account.Web;
@ -78,9 +79,7 @@ namespace Acme.BookStore.Web
ConfigureLocalizationServices(); ConfigureLocalizationServices();
ConfigureNavigationServices(); ConfigureNavigationServices();
ConfigureAutoApiControllers(); ConfigureAutoApiControllers();
ConfigureSwaggerServices(context.Services);
//Disabled swagger since it does not support ASP.NET Core 3.0 yet!
//ConfigureSwaggerServices(context.Services);
} }
private void ConfigureUrls(IConfigurationRoot configuration) private void ConfigureUrls(IConfigurationRoot configuration)
@ -170,7 +169,7 @@ namespace Acme.BookStore.Web
services.AddSwaggerGen( services.AddSwaggerGen(
options => options =>
{ {
options.SwaggerDoc("v1", new Info { Title = "BookStore API", Version = "v1" }); options.SwaggerDoc("v1", new OpenApiInfo { Title = "BookStore API", Version = "v1" });
options.DocInclusionPredicate((docName, description) => true); options.DocInclusionPredicate((docName, description) => true);
options.CustomSchemaIds(type => type.FullName); options.CustomSchemaIds(type => type.FullName);
} }
@ -207,13 +206,11 @@ namespace Acme.BookStore.Web
app.UseIdentityServer(); app.UseIdentityServer();
app.UseAbpRequestLocalization(); app.UseAbpRequestLocalization();
/* Disabled swagger since it does not support ASP.NET Core 3.0 yet!
app.UseSwagger(); app.UseSwagger();
app.UseSwaggerUI(options => app.UseSwaggerUI(options =>
{ {
options.SwaggerEndpoint("/swagger/v1/swagger.json", "BookStore API"); options.SwaggerEndpoint("/swagger/v1/swagger.json", "BookStore API");
}); });
*/
app.UseAuditing(); app.UseAuditing();
app.UseMvcWithDefaultRouteAndArea(); app.UseMvcWithDefaultRouteAndArea();

20
samples/BookStore-Modular/application/src/Acme.BookStore.Web/Program.cs

@ -1,6 +1,7 @@
using System; using System;
using System.IO; using System.IO;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Serilog; using Serilog;
using Serilog.Events; using Serilog.Events;
@ -24,7 +25,7 @@ namespace Acme.BookStore.Web
try try
{ {
Log.Information("Starting web host."); Log.Information("Starting web host.");
BuildWebHostInternal(args).Run(); CreateHostBuilder(args).Build().Run();
return 0; return 0;
} }
catch (Exception ex) catch (Exception ex)
@ -38,14 +39,13 @@ namespace Acme.BookStore.Web
} }
} }
public static IWebHost BuildWebHostInternal(string[] args) => internal static IHostBuilder CreateHostBuilder(string[] args) =>
new WebHostBuilder() Host.CreateDefaultBuilder(args)
.UseKestrel() .ConfigureWebHostDefaults(webBuilder =>
.UseContentRoot(Directory.GetCurrentDirectory()) {
.UseIIS() webBuilder.UseStartup<Startup>();
.UseIISIntegration() })
.UseStartup<Startup>() .UseAutofac()
.UseSerilog() .UseSerilog();
.Build();
} }
} }

9
samples/BookStore-Modular/application/src/Acme.BookStore.Web/Startup.cs

@ -8,14 +8,9 @@ namespace Acme.BookStore.Web
{ {
public class Startup public class Startup
{ {
public IServiceProvider ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddApplication<BookStoreWebModule>(options => services.AddApplication<BookStoreWebModule>();
{
options.UseAutofac();
});
return services.BuildServiceProviderFromFactory();
} }
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)

2
samples/BookStore-Modular/application/test/Acme.BookStore.HttpApi.Client.ConsoleTestApp/Acme.BookStore.HttpApi.Client.ConsoleTestApp.csproj

@ -17,7 +17,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Http.Client.IdentityModel\Volo.Abp.Http.Client.IdentityModel.csproj" />
<ProjectReference Include="..\..\src\Acme.BookStore.HttpApi.Client\Acme.BookStore.HttpApi.Client.csproj" /> <ProjectReference Include="..\..\src\Acme.BookStore.HttpApi.Client\Acme.BookStore.HttpApi.Client.csproj" />
</ItemGroup> </ItemGroup>

6
samples/BookStore-Modular/application/test/Acme.BookStore.TestBase/Acme.BookStore.TestBase.csproj

@ -8,9 +8,9 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.TestBase" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.TestBase\Volo.Abp.TestBase.csproj" />
<PackageReference Include="Volo.Abp.Autofac" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<PackageReference Include="Volo.Abp.Authorization" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Authorization\Volo.Abp.Authorization.csproj" />
<ProjectReference Include="..\..\src\Acme.BookStore.Domain\Acme.BookStore.Domain.csproj" /> <ProjectReference Include="..\..\src\Acme.BookStore.Domain\Acme.BookStore.Domain.csproj" />
</ItemGroup> </ItemGroup>

2
samples/BookStore-Modular/application/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj

@ -17,7 +17,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<ProjectReference Include="..\Acme.BookStore.Application.Tests\Acme.BookStore.Application.Tests.csproj" /> <ProjectReference Include="..\Acme.BookStore.Application.Tests\Acme.BookStore.Application.Tests.csproj" />
<ProjectReference Include="..\..\src\Acme.BookStore.Web\Acme.BookStore.Web.csproj" /> <ProjectReference Include="..\..\src\Acme.BookStore.Web\Acme.BookStore.Web.csproj" />
<PackageReference Include="Volo.Abp.AspNetCore.TestBase" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.TestBase\Volo.Abp.AspNetCore.TestBase.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

5
samples/BookStore-Modular/application/test/Acme.BookStore.Web.Tests/BookStoreWebTestBase.cs

@ -2,6 +2,7 @@
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Serialization;
using Shouldly; using Shouldly;
@ -11,10 +12,10 @@ namespace Acme.BookStore
{ {
public abstract class BookStoreWebTestBase : AbpAspNetCoreIntegratedTestBase<BookStoreWebTestStartup> public abstract class BookStoreWebTestBase : AbpAspNetCoreIntegratedTestBase<BookStoreWebTestStartup>
{ {
protected override IWebHostBuilder CreateWebHostBuilder() protected override IHostBuilder CreateHostBuilder()
{ {
return base return base
.CreateWebHostBuilder() .CreateHostBuilder()
.UseContentRoot(WebContentDirectoryFinder.CalculateContentRootFolder()); .UseContentRoot(WebContentDirectoryFinder.CalculateContentRootFolder());
} }

9
samples/BookStore-Modular/application/test/Acme.BookStore.Web.Tests/BookStoreWebTestStartup.cs

@ -8,14 +8,9 @@ namespace Acme.BookStore
{ {
public class BookStoreWebTestStartup public class BookStoreWebTestStartup
{ {
public IServiceProvider ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddApplication<BookStoreWebTestModule>(options => services.AddApplication<BookStoreWebTestModule>();
{
options.UseAutofac();
});
return services.BuildServiceProviderFromFactory();
} }
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)

18
samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.HttpApi.Host/Acme.BookStore.BookManagement.HttpApi.Host.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\common.props" /> <Import Project="..\..\common.props" />
@ -10,18 +10,18 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="2.1.1" /> <PackageReference Include="Serilog.Extensions.Hosting" Version="3.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" /> <PackageReference Include="Serilog.Sinks.File" Version="4.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc4" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.0" /> <PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.0.0" /> <PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.0.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.0.0" /> <PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.0.0" />
<PackageReference Include="Volo.Abp.Autofac" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<PackageReference Include="Volo.Abp.AspNetCore.MultiTenancy" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.MultiTenancy\Volo.Abp.AspNetCore.MultiTenancy.csproj" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.EntityFrameworkCore.SqlServer\Volo.Abp.EntityFrameworkCore.SqlServer.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.EntityFrameworkCore\Volo.Abp.PermissionManagement.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.EntityFrameworkCore\Volo.Abp.SettingManagement.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.AuditLogging.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.EntityFrameworkCore\Volo.Abp.AuditLogging.EntityFrameworkCore.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

18
samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.HttpApi.Host/BookManagementHttpApiHostModule.cs

@ -6,6 +6,7 @@ using Microsoft.Extensions.Hosting;
using Acme.BookStore.BookManagement.EntityFrameworkCore; using Acme.BookStore.BookManagement.EntityFrameworkCore;
using Acme.BookStore.BookManagement.MultiTenancy; using Acme.BookStore.BookManagement.MultiTenancy;
using StackExchange.Redis; using StackExchange.Redis;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.Swagger; using Swashbuckle.AspNetCore.Swagger;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.AspNetCore.MultiTenancy; using Volo.Abp.AspNetCore.MultiTenancy;
@ -40,7 +41,7 @@ namespace Acme.BookStore.BookManagement
public override void ConfigureServices(ServiceConfigurationContext context) public override void ConfigureServices(ServiceConfigurationContext context)
{ {
var hostingEnvironment = context.Services.GetHostingEnvironment(); var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.BuildConfiguration(); var configuration = context.Services.GetConfiguration();
Configure<AbpDbContextOptions>(options => Configure<AbpDbContextOptions>(options =>
{ {
@ -66,7 +67,7 @@ namespace Acme.BookStore.BookManagement
context.Services.AddSwaggerGen( context.Services.AddSwaggerGen(
options => options =>
{ {
options.SwaggerDoc("v1", new Info { Title = "BookManagement API", Version = "v1" }); options.SwaggerDoc("v1", new OpenApiInfo { Title = "BookManagement API", Version = "v1" });
options.DocInclusionPredicate((docName, description) => true); options.DocInclusionPredicate((docName, description) => true);
options.CustomSchemaIds(type => type.FullName); options.CustomSchemaIds(type => type.FullName);
}); });
@ -131,13 +132,12 @@ namespace Acme.BookStore.BookManagement
{ {
app.UseMultiTenancy(); app.UseMultiTenancy();
} }
app.UseAbpRequestLocalization(); app.UseAbpRequestLocalization();
//TODO: Enable when Swagger supports ASP.NET Core 3.x app.UseSwagger();
//app.UseSwagger(); app.UseSwaggerUI(options =>
//app.UseSwaggerUI(options => {
//{ options.SwaggerEndpoint("/swagger/v1/swagger.json", "Support APP API");
// options.SwaggerEndpoint("/swagger/v1/swagger.json", "Support APP API"); });
//});
app.UseAuditing(); app.UseAuditing();
app.UseMvcWithDefaultRouteAndArea(); app.UseMvcWithDefaultRouteAndArea();
} }

5
samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.HttpApi.Host/Controllers/HomeController.cs

@ -7,10 +7,7 @@ namespace Acme.BookStore.BookManagement.Controllers
{ {
public ActionResult Index() public ActionResult Index()
{ {
//TODO: Enable when Swagger supports ASP.NET Core 3.x return Redirect("/swagger");
//return Redirect("/swagger");
return Content("OK: Acme.BookStore.BookManagement.HttpApi.Host is running...");
} }
} }
} }

20
samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.HttpApi.Host/Program.cs

@ -1,6 +1,7 @@
using System; using System;
using System.IO; using System.IO;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Serilog; using Serilog;
using Serilog.Events; using Serilog.Events;
@ -24,7 +25,7 @@ namespace Acme.BookStore.BookManagement
try try
{ {
Log.Information("Starting web host."); Log.Information("Starting web host.");
BuildWebHostInternal(args).Run(); CreateHostBuilder(args).Build().Run();
return 0; return 0;
} }
catch (Exception ex) catch (Exception ex)
@ -38,14 +39,13 @@ namespace Acme.BookStore.BookManagement
} }
} }
public static IWebHost BuildWebHostInternal(string[] args) => internal static IHostBuilder CreateHostBuilder(string[] args) =>
new WebHostBuilder() Host.CreateDefaultBuilder(args)
.UseKestrel() .ConfigureWebHostDefaults(webBuilder =>
.UseContentRoot(Directory.GetCurrentDirectory()) {
.UseIIS() webBuilder.UseStartup<Startup>();
.UseIISIntegration() })
.UseStartup<Startup>() .UseAutofac()
.UseSerilog() .UseSerilog();
.Build();
} }
} }

11
samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.HttpApi.Host/Startup.cs

@ -9,17 +9,12 @@ namespace Acme.BookStore.BookManagement
{ {
public class Startup public class Startup
{ {
public IServiceProvider ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddApplication<BookManagementHttpApiHostModule>(options => services.AddApplication<BookManagementHttpApiHostModule>();
{
options.UseAutofac();
});
return services.BuildServiceProviderFromFactory();
} }
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{ {
app.InitializeApplication(); app.InitializeApplication();
} }

46
samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Acme.BookStore.BookManagement.IdentityServer.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework> <TargetFramework>netcoreapp3.0</TargetFramework>
@ -8,33 +8,33 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="2.1.1" /> <PackageReference Include="Serilog.Extensions.Hosting" Version="3.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" /> <PackageReference Include="Serilog.Sinks.File" Version="4.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc4" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.0" /> <PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.0.0" /> <PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.0.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.0.0" /> <PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Authentication.JwtBearer\Volo.Abp.AspNetCore.Authentication.JwtBearer.csproj" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc\Volo.Abp.AspNetCore.Mvc.csproj" />
<PackageReference Include="Volo.Abp.AspNetCore.MultiTenancy" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.MultiTenancy\Volo.Abp.AspNetCore.MultiTenancy.csproj" />
<PackageReference Include="Volo.Abp.Autofac" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.EntityFrameworkCore.SqlServer\Volo.Abp.EntityFrameworkCore.SqlServer.csproj" />
<PackageReference Include="Volo.Abp.Account.Web.IdentityServer" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\account\src\Volo.Abp.Account.Web.IdentityServer\Volo.Abp.Account.Web.IdentityServer.csproj" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.EntityFrameworkCore\Volo.Abp.SettingManagement.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.AuditLogging.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.EntityFrameworkCore\Volo.Abp.AuditLogging.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.IdentityServer.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\identityserver\src\Volo.Abp.IdentityServer.EntityFrameworkCore\Volo.Abp.IdentityServer.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.EntityFrameworkCore\Volo.Abp.PermissionManagement.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.Application\Volo.Abp.PermissionManagement.Application.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.HttpApi\Volo.Abp.PermissionManagement.HttpApi.csproj" />
<PackageReference Include="Volo.Abp.Identity.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.EntityFrameworkCore\Volo.Abp.Identity.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.Identity.Application" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Application\Volo.Abp.Identity.Application.csproj" />
<PackageReference Include="Volo.Abp.Identity.HttpApi" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.HttpApi\Volo.Abp.Identity.HttpApi.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Identity" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\identity\src\Volo.Abp.PermissionManagement.Domain.Identity\Volo.Abp.PermissionManagement.Domain.Identity.csproj" />
<PackageReference Include="Volo.Abp.TenantManagement.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.EntityFrameworkCore\Volo.Abp.TenantManagement.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.TenantManagement.Application" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Application\Volo.Abp.TenantManagement.Application.csproj" />
<PackageReference Include="Volo.Abp.TenantManagement.HttpApi" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.HttpApi\Volo.Abp.TenantManagement.HttpApi.csproj" />
<ProjectReference Include="..\..\src\Acme.BookStore.BookManagement.Application.Contracts\Acme.BookStore.BookManagement.Application.Contracts.csproj" /> <ProjectReference Include="..\..\src\Acme.BookStore.BookManagement.Application.Contracts\Acme.BookStore.BookManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\Acme.BookStore.BookManagement.Host.Shared\Acme.BookStore.BookManagement.Host.Shared.csproj" /> <ProjectReference Include="..\Acme.BookStore.BookManagement.Host.Shared\Acme.BookStore.BookManagement.Host.Shared.csproj" />
</ItemGroup> </ItemGroup>

16
samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/BookManagementIdentityServerModule.cs

@ -5,6 +5,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using Acme.BookStore.BookManagement.MultiTenancy; using Acme.BookStore.BookManagement.MultiTenancy;
using StackExchange.Redis; using StackExchange.Redis;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.Swagger; using Swashbuckle.AspNetCore.Swagger;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Account.Web; using Volo.Abp.Account.Web;
@ -64,7 +65,7 @@ namespace Acme.BookStore.BookManagement
public override void ConfigureServices(ServiceConfigurationContext context) public override void ConfigureServices(ServiceConfigurationContext context)
{ {
var hostingEnvironment = context.Services.GetHostingEnvironment(); var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.BuildConfiguration(); var configuration = context.Services.GetConfiguration();
Configure<AbpDbContextOptions>(options => Configure<AbpDbContextOptions>(options =>
{ {
@ -74,7 +75,7 @@ namespace Acme.BookStore.BookManagement
context.Services.AddSwaggerGen( context.Services.AddSwaggerGen(
options => options =>
{ {
options.SwaggerDoc("v1", new Info { Title = "BookManagement API", Version = "v1" }); options.SwaggerDoc("v1", new OpenApiInfo { Title = "BookManagement API", Version = "v1" });
options.DocInclusionPredicate((docName, description) => true); options.DocInclusionPredicate((docName, description) => true);
options.CustomSchemaIds(type => type.FullName); options.CustomSchemaIds(type => type.FullName);
}); });
@ -147,12 +148,11 @@ namespace Acme.BookStore.BookManagement
} }
app.UseIdentityServer(); app.UseIdentityServer();
app.UseAbpRequestLocalization(); app.UseAbpRequestLocalization();
//TODO: Enable when Swagger supports ASP.NET Core 3.x app.UseSwagger();
//app.UseSwagger(); app.UseSwaggerUI(options =>
//app.UseSwaggerUI(options => {
//{ options.SwaggerEndpoint("/swagger/v1/swagger.json", "Support APP API");
// options.SwaggerEndpoint("/swagger/v1/swagger.json", "Support APP API"); });
//});
app.UseAuditing(); app.UseAuditing();
app.UseMvcWithDefaultRouteAndArea(); app.UseMvcWithDefaultRouteAndArea();

9
samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/IdentityServer/IdentityServerDataSeedContributor.cs

@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Volo.Abp.Authorization.Permissions; using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Configuration; using Volo.Abp.Configuration;
using Volo.Abp.Data; using Volo.Abp.Data;
@ -21,7 +22,7 @@ namespace Acme.BookStore.BookManagement.IdentityServer
private readonly IIdentityResourceDataSeeder _identityResourceDataSeeder; private readonly IIdentityResourceDataSeeder _identityResourceDataSeeder;
private readonly IGuidGenerator _guidGenerator; private readonly IGuidGenerator _guidGenerator;
private readonly IPermissionDataSeeder _permissionDataSeeder; private readonly IPermissionDataSeeder _permissionDataSeeder;
private readonly IConfigurationAccessor _configurationAccessor; private readonly IConfiguration _configuration;
public IdentityServerDataSeedContributor( public IdentityServerDataSeedContributor(
IClientRepository clientRepository, IClientRepository clientRepository,
@ -29,14 +30,14 @@ namespace Acme.BookStore.BookManagement.IdentityServer
IIdentityResourceDataSeeder identityResourceDataSeeder, IIdentityResourceDataSeeder identityResourceDataSeeder,
IGuidGenerator guidGenerator, IGuidGenerator guidGenerator,
IPermissionDataSeeder permissionDataSeeder, IPermissionDataSeeder permissionDataSeeder,
IConfigurationAccessor configurationAccessor) IConfiguration configuration)
{ {
_clientRepository = clientRepository; _clientRepository = clientRepository;
_apiResourceRepository = apiResourceRepository; _apiResourceRepository = apiResourceRepository;
_identityResourceDataSeeder = identityResourceDataSeeder; _identityResourceDataSeeder = identityResourceDataSeeder;
_guidGenerator = guidGenerator; _guidGenerator = guidGenerator;
_permissionDataSeeder = permissionDataSeeder; _permissionDataSeeder = permissionDataSeeder;
_configurationAccessor = configurationAccessor; _configuration = configuration;
} }
[UnitOfWork] [UnitOfWork]
@ -103,7 +104,7 @@ namespace Acme.BookStore.BookManagement.IdentityServer
"BookManagement" "BookManagement"
}; };
var configurationSection = _configurationAccessor.Configuration.GetSection("IdentityServer:Clients"); var configurationSection = _configuration.GetSection("IdentityServer:Clients");
//Web Client //Web Client
var webClientId = configurationSection["BookManagement_Web:ClientId"]; var webClientId = configurationSection["BookManagement_Web:ClientId"];

20
samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Program.cs

@ -1,6 +1,7 @@
using System; using System;
using System.IO; using System.IO;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Serilog; using Serilog;
using Serilog.Events; using Serilog.Events;
@ -24,7 +25,7 @@ namespace Acme.BookStore.BookManagement
try try
{ {
Log.Information("Starting web host."); Log.Information("Starting web host.");
BuildWebHostInternal(args).Run(); CreateHostBuilder(args).Build().Run();
return 0; return 0;
} }
catch (Exception ex) catch (Exception ex)
@ -38,14 +39,13 @@ namespace Acme.BookStore.BookManagement
} }
} }
public static IWebHost BuildWebHostInternal(string[] args) => internal static IHostBuilder CreateHostBuilder(string[] args) =>
new WebHostBuilder() Host.CreateDefaultBuilder(args)
.UseKestrel() .ConfigureWebHostDefaults(webBuilder =>
.UseContentRoot(Directory.GetCurrentDirectory()) {
.UseIIS() webBuilder.UseStartup<Startup>();
.UseIISIntegration() })
.UseStartup<Startup>() .UseAutofac()
.UseSerilog() .UseSerilog();
.Build();
} }
} }

11
samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Startup.cs

@ -9,17 +9,12 @@ namespace Acme.BookStore.BookManagement
{ {
public class Startup public class Startup
{ {
public IServiceProvider ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddApplication<BookManagementIdentityServerModule>(options => services.AddApplication<BookManagementIdentityServerModule>();
{
options.UseAutofac();
});
return services.BuildServiceProviderFromFactory();
} }
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{ {
app.InitializeApplication(); app.InitializeApplication();
} }

26
samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/Acme.BookStore.BookManagement.Web.Host.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\common.props" /> <Import Project="..\..\common.props" />
@ -10,22 +10,22 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="2.1.1" /> <PackageReference Include="Serilog.Extensions.Hosting" Version="3.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" /> <PackageReference Include="Serilog.Sinks.File" Version="4.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc4" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="3.0.0" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.0.0" /> <PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.0.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.0.0" /> <PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.0.0" />
<PackageReference Include="Volo.Abp.Autofac" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.Client" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.Client\Volo.Abp.AspNetCore.Mvc.Client.csproj" />
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.OAuth" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Authentication.OAuth\Volo.Abp.AspNetCore.Authentication.OAuth.csproj" />
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.Http.Client.IdentityModel\Volo.Abp.Http.Client.IdentityModel.csproj" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
<PackageReference Include="Volo.Abp.Identity.Web" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Web\Volo.Abp.Identity.Web.csproj" />
<PackageReference Include="Volo.Abp.Identity.HttpApi.Client" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.HttpApi.Client\Volo.Abp.Identity.HttpApi.Client.csproj" />
<PackageReference Include="Volo.Abp.TenantManagement.Web" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Web\Volo.Abp.TenantManagement.Web.csproj" />
<PackageReference Include="Volo.Abp.TenantManagement.HttpApi.Client" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.HttpApi.Client\Volo.Abp.TenantManagement.HttpApi.Client.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi.Client" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.HttpApi.Client\Volo.Abp.PermissionManagement.HttpApi.Client.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

14
samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/BookManagementWebHostModule.cs

@ -2,6 +2,7 @@ using System;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.Swagger; using Swashbuckle.AspNetCore.Swagger;
using System.IO; using System.IO;
using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication;
@ -167,7 +168,7 @@ namespace Acme.BookStore.BookManagement
services.AddSwaggerGen( services.AddSwaggerGen(
options => options =>
{ {
options.SwaggerDoc("v1", new Info { Title = "BookManagement API", Version = "v1" }); options.SwaggerDoc("v1", new OpenApiInfo { Title = "BookManagement API", Version = "v1" });
options.DocInclusionPredicate((docName, description) => true); options.DocInclusionPredicate((docName, description) => true);
options.CustomSchemaIds(type => type.FullName); options.CustomSchemaIds(type => type.FullName);
} }
@ -221,12 +222,11 @@ namespace Acme.BookStore.BookManagement
app.UseAbpRequestLocalization(); app.UseAbpRequestLocalization();
//TODO: Enable when Swagger supports ASP.NET Core 3.x app.UseSwagger();
//app.UseSwagger(); app.UseSwaggerUI(options =>
//app.UseSwaggerUI(options => {
//{ options.SwaggerEndpoint("/swagger/v1/swagger.json", "BookManagement API");
// options.SwaggerEndpoint("/swagger/v1/swagger.json", "BookManagement API"); });
//});
app.UseAuditing(); app.UseAuditing();

20
samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/Program.cs

@ -1,6 +1,7 @@
using System; using System;
using System.IO; using System.IO;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Serilog; using Serilog;
using Serilog.Events; using Serilog.Events;
@ -24,7 +25,7 @@ namespace Acme.BookStore.BookManagement
try try
{ {
Log.Information("Starting web host."); Log.Information("Starting web host.");
BuildWebHostInternal(args).Run(); CreateHostBuilder(args).Build().Run();
return 0; return 0;
} }
catch (Exception ex) catch (Exception ex)
@ -38,14 +39,13 @@ namespace Acme.BookStore.BookManagement
} }
} }
public static IWebHost BuildWebHostInternal(string[] args) => internal static IHostBuilder CreateHostBuilder(string[] args) =>
new WebHostBuilder() Host.CreateDefaultBuilder(args)
.UseKestrel() .ConfigureWebHostDefaults(webBuilder =>
.UseContentRoot(Directory.GetCurrentDirectory()) {
.UseIIS() webBuilder.UseStartup<Startup>();
.UseIISIntegration() })
.UseStartup<Startup>() .UseAutofac()
.UseSerilog() .UseSerilog();
.Build();
} }
} }

9
samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/Startup.cs

@ -8,14 +8,9 @@ namespace Acme.BookStore.BookManagement
{ {
public class Startup public class Startup
{ {
public IServiceProvider ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddApplication<BookManagementWebHostModule>(options => services.AddApplication<BookManagementWebHostModule>();
{
options.UseAutofac();
});
return services.BuildServiceProviderFromFactory();
} }
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)

36
samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Acme.BookStore.BookManagement.Web.Unified.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\common.props" /> <Import Project="..\..\common.props" />
@ -10,25 +10,25 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="2.1.1" /> <PackageReference Include="Serilog.Extensions.Hosting" Version="3.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" /> <PackageReference Include="Serilog.Sinks.File" Version="4.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0" />
<PackageReference Include="Volo.Abp.Autofac" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.EntityFrameworkCore.SqlServer\Volo.Abp.EntityFrameworkCore.SqlServer.csproj" />
<PackageReference Include="Volo.Abp.AuditLogging.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.EntityFrameworkCore\Volo.Abp.AuditLogging.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.Account.Web" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\account\src\Volo.Abp.Account.Web\Volo.Abp.Account.Web.csproj" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.EntityFrameworkCore\Volo.Abp.SettingManagement.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.Application\Volo.Abp.PermissionManagement.Application.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.EntityFrameworkCore\Volo.Abp.PermissionManagement.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.Identity.Application" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Application\Volo.Abp.Identity.Application.csproj" />
<PackageReference Include="Volo.Abp.Identity.Web" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Web\Volo.Abp.Identity.Web.csproj" />
<PackageReference Include="Volo.Abp.Identity.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.EntityFrameworkCore\Volo.Abp.Identity.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Identity" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\identity\src\Volo.Abp.PermissionManagement.Domain.Identity\Volo.Abp.PermissionManagement.Domain.Identity.csproj" />
<PackageReference Include="Volo.Abp.TenantManagement.Application" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Application\Volo.Abp.TenantManagement.Application.csproj" />
<PackageReference Include="Volo.Abp.TenantManagement.Web" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Web\Volo.Abp.TenantManagement.Web.csproj" />
<PackageReference Include="Volo.Abp.TenantManagement.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.EntityFrameworkCore\Volo.Abp.TenantManagement.EntityFrameworkCore.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

16
samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/BookManagementWebUnifiedModule.cs

@ -6,6 +6,7 @@ using Microsoft.Extensions.Hosting;
using Acme.BookStore.BookManagement.EntityFrameworkCore; using Acme.BookStore.BookManagement.EntityFrameworkCore;
using Acme.BookStore.BookManagement.MultiTenancy; using Acme.BookStore.BookManagement.MultiTenancy;
using Acme.BookStore.BookManagement.Web; using Acme.BookStore.BookManagement.Web;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.Swagger; using Swashbuckle.AspNetCore.Swagger;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Account.Web; using Volo.Abp.Account.Web;
@ -59,7 +60,7 @@ namespace Acme.BookStore.BookManagement
public override void ConfigureServices(ServiceConfigurationContext context) public override void ConfigureServices(ServiceConfigurationContext context)
{ {
var hostingEnvironment = context.Services.GetHostingEnvironment(); var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.BuildConfiguration(); var configuration = context.Services.GetConfiguration();
Configure<AbpDbContextOptions>(options => Configure<AbpDbContextOptions>(options =>
{ {
@ -81,7 +82,7 @@ namespace Acme.BookStore.BookManagement
context.Services.AddSwaggerGen( context.Services.AddSwaggerGen(
options => options =>
{ {
options.SwaggerDoc("v1", new Info { Title = "BookManagement API", Version = "v1" }); options.SwaggerDoc("v1", new OpenApiInfo { Title = "BookManagement API", Version = "v1" });
options.DocInclusionPredicate((docName, description) => true); options.DocInclusionPredicate((docName, description) => true);
options.CustomSchemaIds(type => type.FullName); options.CustomSchemaIds(type => type.FullName);
}); });
@ -125,12 +126,11 @@ namespace Acme.BookStore.BookManagement
app.UseMultiTenancy(); app.UseMultiTenancy();
} }
//TODO: Enabled when Swagger supports ASP.NET Core 3.x app.UseSwagger();
//app.UseSwagger(); app.UseSwaggerUI(options =>
//app.UseSwaggerUI(options => {
//{ options.SwaggerEndpoint("/swagger/v1/swagger.json", "Support APP API");
// options.SwaggerEndpoint("/swagger/v1/swagger.json", "Support APP API"); });
//});
app.UseAbpRequestLocalization(); app.UseAbpRequestLocalization();
app.UseAuditing(); app.UseAuditing();

20
samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Program.cs

@ -1,6 +1,7 @@
using System; using System;
using System.IO; using System.IO;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Serilog; using Serilog;
using Serilog.Events; using Serilog.Events;
@ -20,7 +21,7 @@ namespace Acme.BookStore.BookManagement
try try
{ {
Log.Information("Starting web host."); Log.Information("Starting web host.");
BuildWebHostInternal(args).Run(); CreateHostBuilder(args).Build().Run();
return 0; return 0;
} }
catch (Exception ex) catch (Exception ex)
@ -34,14 +35,13 @@ namespace Acme.BookStore.BookManagement
} }
} }
public static IWebHost BuildWebHostInternal(string[] args) => internal static IHostBuilder CreateHostBuilder(string[] args) =>
new WebHostBuilder() Host.CreateDefaultBuilder(args)
.UseKestrel() .ConfigureWebHostDefaults(webBuilder =>
.UseContentRoot(Directory.GetCurrentDirectory()) {
.UseIIS() webBuilder.UseStartup<Startup>();
.UseIISIntegration() })
.UseStartup<Startup>() .UseAutofac()
.UseSerilog() .UseSerilog();
.Build();
} }
} }

11
samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Startup.cs

@ -9,17 +9,12 @@ namespace Acme.BookStore.BookManagement
{ {
public class Startup public class Startup
{ {
public IServiceProvider ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddApplication<BookManagementWebUnifiedModule>(options => services.AddApplication<BookManagementWebUnifiedModule>();
{
options.UseAutofac();
});
return services.BuildServiceProviderFromFactory();
} }
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{ {
app.InitializeApplication(); app.InitializeApplication();
} }

4
samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.Application.Contracts/Acme.BookStore.BookManagement.Application.Contracts.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" /> <Import Project="..\..\common.props" />
@ -8,7 +8,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Application" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.Ddd.Application\Volo.Abp.Ddd.Application.csproj" />
<ProjectReference Include="..\Acme.BookStore.BookManagement.Domain.Shared\Acme.BookStore.BookManagement.Domain.Shared.csproj" /> <ProjectReference Include="..\Acme.BookStore.BookManagement.Domain.Shared\Acme.BookStore.BookManagement.Domain.Shared.csproj" />
</ItemGroup> </ItemGroup>

4
samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.Application/Acme.BookStore.BookManagement.Application.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" /> <Import Project="..\..\common.props" />
@ -8,7 +8,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.AutoMapper\Volo.Abp.AutoMapper.csproj" />
<ProjectReference Include="..\Acme.BookStore.BookManagement.Application.Contracts\Acme.BookStore.BookManagement.Application.Contracts.csproj" /> <ProjectReference Include="..\Acme.BookStore.BookManagement.Application.Contracts\Acme.BookStore.BookManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\Acme.BookStore.BookManagement.Domain\Acme.BookStore.BookManagement.Domain.csproj" /> <ProjectReference Include="..\Acme.BookStore.BookManagement.Domain\Acme.BookStore.BookManagement.Domain.csproj" />
</ItemGroup> </ItemGroup>

4
samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.Domain.Shared/Acme.BookStore.BookManagement.Domain.Shared.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" /> <Import Project="..\..\common.props" />
@ -8,7 +8,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Localization" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.Localization\Volo.Abp.Localization.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

4
samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.Domain/Acme.BookStore.BookManagement.Domain.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" /> <Import Project="..\..\common.props" />
@ -8,7 +8,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.Ddd.Domain\Volo.Abp.Ddd.Domain.csproj" />
<ProjectReference Include="..\Acme.BookStore.BookManagement.Domain.Shared\Acme.BookStore.BookManagement.Domain.Shared.csproj" /> <ProjectReference Include="..\Acme.BookStore.BookManagement.Domain.Shared\Acme.BookStore.BookManagement.Domain.Shared.csproj" />
</ItemGroup> </ItemGroup>

4
samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.EntityFrameworkCore/Acme.BookStore.BookManagement.EntityFrameworkCore.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" /> <Import Project="..\..\common.props" />
@ -8,7 +8,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.EntityFrameworkCore\Volo.Abp.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\Acme.BookStore.BookManagement.Domain\Acme.BookStore.BookManagement.Domain.csproj" /> <ProjectReference Include="..\Acme.BookStore.BookManagement.Domain\Acme.BookStore.BookManagement.Domain.csproj" />
</ItemGroup> </ItemGroup>

4
samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.HttpApi.Client/Acme.BookStore.BookManagement.HttpApi.Client.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" /> <Import Project="..\..\common.props" />
@ -8,7 +8,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.Http.Client\Volo.Abp.Http.Client.csproj" />
<ProjectReference Include="..\Acme.BookStore.BookManagement.Application.Contracts\Acme.BookStore.BookManagement.Application.Contracts.csproj" /> <ProjectReference Include="..\Acme.BookStore.BookManagement.Application.Contracts\Acme.BookStore.BookManagement.Application.Contracts.csproj" />
</ItemGroup> </ItemGroup>

4
samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.HttpApi/Acme.BookStore.BookManagement.HttpApi.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" /> <Import Project="..\..\common.props" />
@ -8,7 +8,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc\Volo.Abp.AspNetCore.Mvc.csproj" />
<ProjectReference Include="..\Acme.BookStore.BookManagement.Application.Contracts\Acme.BookStore.BookManagement.Application.Contracts.csproj" /> <ProjectReference Include="..\Acme.BookStore.BookManagement.Application.Contracts\Acme.BookStore.BookManagement.Application.Contracts.csproj" />
</ItemGroup> </ItemGroup>

4
samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.MongoDB/Acme.BookStore.BookManagement.MongoDB.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" /> <Import Project="..\..\common.props" />
@ -8,7 +8,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.MongoDB" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.MongoDB\Volo.Abp.MongoDB.csproj" />
<ProjectReference Include="..\Acme.BookStore.BookManagement.Domain\Acme.BookStore.BookManagement.Domain.csproj" /> <ProjectReference Include="..\Acme.BookStore.BookManagement.Domain\Acme.BookStore.BookManagement.Domain.csproj" />
</ItemGroup> </ItemGroup>

6
samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.Web/Acme.BookStore.BookManagement.Web.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\common.props" /> <Import Project="..\..\common.props" />
@ -11,8 +11,8 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.AutoMapper\Volo.Abp.AutoMapper.csproj" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared\Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

4
samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.HttpApi.Client.ConsoleTestApp/Acme.BookStore.BookManagement.HttpApi.Client.ConsoleTestApp.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
@ -7,7 +7,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.Http.Client.IdentityModel\Volo.Abp.Http.Client.IdentityModel.csproj" />
<ProjectReference Include="..\..\src\Acme.BookStore.BookManagement.HttpApi.Client\Acme.BookStore.BookManagement.HttpApi.Client.csproj" /> <ProjectReference Include="..\..\src\Acme.BookStore.BookManagement.HttpApi.Client\Acme.BookStore.BookManagement.HttpApi.Client.csproj" />
</ItemGroup> </ItemGroup>

37
samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs

@ -4,6 +4,7 @@ using System.Threading.Tasks;
using IdentityModel.Client; using IdentityModel.Client;
using Acme.BookStore.BookManagement.Books; using Acme.BookStore.BookManagement.Books;
using Acme.BookStore.BookManagement.Samples; using Acme.BookStore.BookManagement.Samples;
using Microsoft.Extensions.Configuration;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Volo.Abp.Configuration; using Volo.Abp.Configuration;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
@ -15,18 +16,18 @@ namespace Acme.BookStore.BookManagement
{ {
private readonly ISampleAppService _sampleAppService; private readonly ISampleAppService _sampleAppService;
private readonly IIdentityModelAuthenticationService _authenticationService; private readonly IIdentityModelAuthenticationService _authenticationService;
private readonly IConfigurationAccessor _configurationAccessor; private readonly IConfiguration _configuration;
private readonly IBookAppService _bookAppService; private readonly IBookAppService _bookAppService;
public ClientDemoService( public ClientDemoService(
ISampleAppService sampleAppService, ISampleAppService sampleAppService,
IIdentityModelAuthenticationService authenticationService, IIdentityModelAuthenticationService authenticationService,
IConfigurationAccessor configurationAccessor, IConfiguration configuration,
IBookAppService bookAppService) IBookAppService bookAppService)
{ {
_sampleAppService = sampleAppService; _sampleAppService = sampleAppService;
_authenticationService = authenticationService; _authenticationService = authenticationService;
_configurationAccessor = configurationAccessor; _configuration = configuration;
_bookAppService = bookAppService; _bookAppService = bookAppService;
} }
@ -71,13 +72,13 @@ namespace Acme.BookStore.BookManagement
var accessToken = await _authenticationService.GetAccessTokenAsync( var accessToken = await _authenticationService.GetAccessTokenAsync(
new IdentityClientConfiguration( new IdentityClientConfiguration(
_configurationAccessor.Configuration["IdentityClients:Default:Authority"], _configuration["IdentityClients:Default:Authority"],
_configurationAccessor.Configuration["IdentityClients:Default:Scope"], _configuration["IdentityClients:Default:Scope"],
_configurationAccessor.Configuration["IdentityClients:Default:ClientId"], _configuration["IdentityClients:Default:ClientId"],
_configurationAccessor.Configuration["IdentityClients:Default:ClientSecret"], _configuration["IdentityClients:Default:ClientSecret"],
_configurationAccessor.Configuration["IdentityClients:Default:GrantType"], _configuration["IdentityClients:Default:GrantType"],
_configurationAccessor.Configuration["IdentityClients:Default:UserName"], _configuration["IdentityClients:Default:UserName"],
_configurationAccessor.Configuration["IdentityClients:Default:UserPassword"] _configuration["IdentityClients:Default:UserPassword"]
) )
); );
@ -87,7 +88,7 @@ namespace Acme.BookStore.BookManagement
{ {
httpClient.SetBearerToken(accessToken); httpClient.SetBearerToken(accessToken);
var url = _configurationAccessor.Configuration["RemoteServices:BookManagement:BaseUrl"] + var url = _configuration["RemoteServices:BookManagement:BaseUrl"] +
"api/BookManagement/sample/authorized"; "api/BookManagement/sample/authorized";
var responseMessage = await httpClient.GetAsync(url); var responseMessage = await httpClient.GetAsync(url);
@ -116,7 +117,7 @@ namespace Acme.BookStore.BookManagement
// discover endpoints from metadata // discover endpoints from metadata
var client = new HttpClient(); var client = new HttpClient();
var disco = await client.GetDiscoveryDocumentAsync(_configurationAccessor.Configuration["IdentityClients:Default:Authority"]); var disco = await client.GetDiscoveryDocumentAsync(_configuration["IdentityClients:Default:Authority"]);
if (disco.IsError) if (disco.IsError)
{ {
Console.WriteLine(disco.Error); Console.WriteLine(disco.Error);
@ -127,11 +128,11 @@ namespace Acme.BookStore.BookManagement
var tokenResponse = await client.RequestPasswordTokenAsync(new PasswordTokenRequest var tokenResponse = await client.RequestPasswordTokenAsync(new PasswordTokenRequest
{ {
Address = disco.TokenEndpoint, Address = disco.TokenEndpoint,
ClientId = _configurationAccessor.Configuration["IdentityClients:Default:ClientId"], ClientId = _configuration["IdentityClients:Default:ClientId"],
ClientSecret = _configurationAccessor.Configuration["IdentityClients:Default:ClientSecret"], ClientSecret = _configuration["IdentityClients:Default:ClientSecret"],
UserName = _configurationAccessor.Configuration["IdentityClients:Default:UserName"], UserName = _configuration["IdentityClients:Default:UserName"],
Password = _configurationAccessor.Configuration["IdentityClients:Default:UserPassword"], Password = _configuration["IdentityClients:Default:UserPassword"],
Scope = _configurationAccessor.Configuration["IdentityClients:Default:Scope"] Scope = _configuration["IdentityClients:Default:Scope"]
}); });
if (tokenResponse.IsError) if (tokenResponse.IsError)
@ -148,7 +149,7 @@ namespace Acme.BookStore.BookManagement
{ {
httpClient.SetBearerToken(tokenResponse.AccessToken); httpClient.SetBearerToken(tokenResponse.AccessToken);
var url = _configurationAccessor.Configuration["RemoteServices:BookManagement:BaseUrl"] + var url = _configuration["RemoteServices:BookManagement:BaseUrl"] +
"api/BookManagement/sample/authorized"; "api/BookManagement/sample/authorized";
var responseMessage = await httpClient.GetAsync(url); var responseMessage = await httpClient.GetAsync(url);

9
samples/BookStore/src/Acme.BookStore.Application.Contracts/Acme.BookStore.Application.Contracts.csproj

@ -12,10 +12,11 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Identity.Application.Contracts" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Application.Contracts\Volo.Abp.Account.Application.Contracts.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application.Contracts" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Application.Contracts\Volo.Abp.Identity.Application.Contracts.csproj" />
<PackageReference Include="Volo.Abp.TenantManagement.Application.Contracts" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.Application.Contracts\Volo.Abp.PermissionManagement.Application.Contracts.csproj" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application.Contracts" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Application.Contracts\Volo.Abp.TenantManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Application.Contracts\Volo.Abp.FeatureManagement.Application.Contracts.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

9
samples/BookStore/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj

@ -13,10 +13,11 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Identity.Application" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Application\Volo.Abp.Account.Application.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Application\Volo.Abp.Identity.Application.csproj" />
<PackageReference Include="Volo.Abp.TenantManagement.Application" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.Application\Volo.Abp.PermissionManagement.Application.csproj" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Application\Volo.Abp.TenantManagement.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Application\Volo.Abp.FeatureManagement.Application.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

2
samples/BookStore/src/Acme.BookStore.DbMigrator/Acme.BookStore.DbMigrator.csproj

@ -29,7 +29,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Autofac" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\Acme.BookStore.Application.Contracts\Acme.BookStore.Application.Contracts.csproj" /> <ProjectReference Include="..\Acme.BookStore.Application.Contracts\Acme.BookStore.Application.Contracts.csproj" />
<ProjectReference Include="..\Acme.BookStore.EntityFrameworkCore.DbMigrations\Acme.BookStore.EntityFrameworkCore.DbMigrations.csproj" /> <ProjectReference Include="..\Acme.BookStore.EntityFrameworkCore.DbMigrations\Acme.BookStore.EntityFrameworkCore.DbMigrations.csproj" />
</ItemGroup> </ItemGroup>

16
samples/BookStore/src/Acme.BookStore.Domain.Shared/Acme.BookStore.Domain.Shared.csproj

@ -8,14 +8,14 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Identity.Domain.Shared" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Domain.Shared\Volo.Abp.Identity.Domain.Shared.csproj" />
<PackageReference Include="Volo.Abp.IdentityServer.Domain.Shared" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\identityserver\src\Volo.Abp.IdentityServer.Domain.Shared\Volo.Abp.IdentityServer.Domain.Shared.csproj" />
<PackageReference Include="Volo.Abp.BackgroundJobs.Domain.Shared" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\background-jobs\src\Volo.Abp.BackgroundJobs.Domain.Shared\Volo.Abp.BackgroundJobs.Domain.Shared.csproj" />
<PackageReference Include="Volo.Abp.AuditLogging.Domain.Shared" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.Domain.Shared\Volo.Abp.AuditLogging.Domain.Shared.csproj" />
<PackageReference Include="Volo.Abp.TenantManagement.Domain.Shared" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Domain.Shared\Volo.Abp.TenantManagement.Domain.Shared.csproj" />
<PackageReference Include="Volo.Abp.FeatureManagement.Domain.Shared" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Domain.Shared\Volo.Abp.FeatureManagement.Domain.Shared.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Shared" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.Domain.Shared\Volo.Abp.PermissionManagement.Domain.Shared.csproj" />
<PackageReference Include="Volo.Abp.SettingManagement.Domain.Shared" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.Domain.Shared\Volo.Abp.SettingManagement.Domain.Shared.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

18
samples/BookStore/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj

@ -13,15 +13,15 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.DataAnnotations" Version="2.2.0" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.DataAnnotations" Version="2.2.0" />
<PackageReference Include="Volo.Abp.Identity.Domain" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Domain\Volo.Abp.Identity.Domain.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Identity" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.PermissionManagement.Domain.Identity\Volo.Abp.PermissionManagement.Domain.Identity.csproj" />
<PackageReference Include="Volo.Abp.IdentityServer.Domain" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\identityserver\src\Volo.Abp.IdentityServer.Domain\Volo.Abp.IdentityServer.Domain.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.IdentityServer" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\identityserver\src\Volo.Abp.PermissionManagement.Domain.IdentityServer\Volo.Abp.PermissionManagement.Domain.IdentityServer.csproj" />
<PackageReference Include="Volo.Abp.BackgroundJobs.Domain" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\background-jobs\src\Volo.Abp.BackgroundJobs.Domain\Volo.Abp.BackgroundJobs.Domain.csproj" />
<PackageReference Include="Volo.Abp.AuditLogging.Domain" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.Domain\Volo.Abp.AuditLogging.Domain.csproj" />
<PackageReference Include="Volo.Abp.TenantManagement.Domain" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Domain\Volo.Abp.TenantManagement.Domain.csproj" />
<PackageReference Include="Volo.Abp.FeatureManagement.Domain" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Domain\Volo.Abp.FeatureManagement.Domain.csproj" />
<PackageReference Include="Volo.Abp.SettingManagement.Domain" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.Domain\Volo.Abp.SettingManagement.Domain.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

5
samples/BookStore/src/Acme.BookStore.Domain/Book.cs

@ -13,6 +13,11 @@ namespace Acme.BookStore
public float Price { get; set; } public float Price { get; set; }
protected Book()
{
}
public Book(Guid id, string name, BookType type, DateTime publishDate, float price) public Book(Guid id, string name, BookType type, DateTime publishDate, float price)
:base(id) :base(id)
{ {

9
samples/BookStore/src/Acme.BookStore.Domain/IdentityServer/IdentityServerDataSeedContributor.cs

@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Volo.Abp.Authorization.Permissions; using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Configuration; using Volo.Abp.Configuration;
using Volo.Abp.Data; using Volo.Abp.Data;
@ -21,7 +22,7 @@ namespace Acme.BookStore.IdentityServer
private readonly IIdentityResourceDataSeeder _identityResourceDataSeeder; private readonly IIdentityResourceDataSeeder _identityResourceDataSeeder;
private readonly IGuidGenerator _guidGenerator; private readonly IGuidGenerator _guidGenerator;
private readonly IPermissionDataSeeder _permissionDataSeeder; private readonly IPermissionDataSeeder _permissionDataSeeder;
private readonly IConfigurationAccessor _configurationAccessor; private readonly IConfiguration _configuration;
public IdentityServerDataSeedContributor( public IdentityServerDataSeedContributor(
IClientRepository clientRepository, IClientRepository clientRepository,
@ -29,14 +30,14 @@ namespace Acme.BookStore.IdentityServer
IIdentityResourceDataSeeder identityResourceDataSeeder, IIdentityResourceDataSeeder identityResourceDataSeeder,
IGuidGenerator guidGenerator, IGuidGenerator guidGenerator,
IPermissionDataSeeder permissionDataSeeder, IPermissionDataSeeder permissionDataSeeder,
IConfigurationAccessor configurationAccessor) IConfiguration configuration)
{ {
_clientRepository = clientRepository; _clientRepository = clientRepository;
_apiResourceRepository = apiResourceRepository; _apiResourceRepository = apiResourceRepository;
_identityResourceDataSeeder = identityResourceDataSeeder; _identityResourceDataSeeder = identityResourceDataSeeder;
_guidGenerator = guidGenerator; _guidGenerator = guidGenerator;
_permissionDataSeeder = permissionDataSeeder; _permissionDataSeeder = permissionDataSeeder;
_configurationAccessor = configurationAccessor; _configuration = configuration;
} }
[UnitOfWork] [UnitOfWork]
@ -103,7 +104,7 @@ namespace Acme.BookStore.IdentityServer
"BookStore" "BookStore"
}; };
var configurationSection = _configurationAccessor.Configuration.GetSection("IdentityServer:Clients"); var configurationSection = _configuration.GetSection("IdentityServer:Clients");
//Web Client //Web Client
var webClientId = configurationSection["BookStore_Web:ClientId"]; var webClientId = configurationSection["BookStore_Web:ClientId"];

18
samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Acme.BookStore.EntityFrameworkCore.csproj

@ -9,15 +9,15 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Acme.BookStore.Domain\Acme.BookStore.Domain.csproj" /> <ProjectReference Include="..\Acme.BookStore.Domain\Acme.BookStore.Domain.csproj" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.EntityFrameworkCore.SqlServer\Volo.Abp.EntityFrameworkCore.SqlServer.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.EntityFrameworkCore\Volo.Abp.PermissionManagement.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.EntityFrameworkCore\Volo.Abp.SettingManagement.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.Identity.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.EntityFrameworkCore\Volo.Abp.Identity.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.IdentityServer.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\identityserver\src\Volo.Abp.IdentityServer.EntityFrameworkCore\Volo.Abp.IdentityServer.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.BackgroundJobs.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\background-jobs\src\Volo.Abp.BackgroundJobs.EntityFrameworkCore\Volo.Abp.BackgroundJobs.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.AuditLogging.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.EntityFrameworkCore\Volo.Abp.AuditLogging.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.TenantManagement.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.EntityFrameworkCore\Volo.Abp.TenantManagement.EntityFrameworkCore.csproj" />
<PackageReference Include="Volo.Abp.FeatureManagement.EntityFrameworkCore" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.EntityFrameworkCore\Volo.Abp.FeatureManagement.EntityFrameworkCore.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

9
samples/BookStore/src/Acme.BookStore.HttpApi.Client/Acme.BookStore.HttpApi.Client.csproj

@ -12,10 +12,11 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Identity.HttpApi.Client" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.HttpApi.Client\Volo.Abp.Account.HttpApi.Client.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi.Client" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.HttpApi.Client\Volo.Abp.Identity.HttpApi.Client.csproj" />
<PackageReference Include="Volo.Abp.TenantManagement.HttpApi.Client" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.HttpApi.Client\Volo.Abp.PermissionManagement.HttpApi.Client.csproj" />
<PackageReference Include="Volo.Abp.FeatureManagement.HttpApi.Client" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.HttpApi.Client\Volo.Abp.TenantManagement.HttpApi.Client.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.HttpApi.Client\Volo.Abp.FeatureManagement.HttpApi.Client.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

9
samples/BookStore/src/Acme.BookStore.HttpApi/Acme.BookStore.HttpApi.csproj

@ -12,10 +12,11 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Identity.HttpApi" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.HttpApi\Volo.Abp.Account.HttpApi.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.HttpApi\Volo.Abp.Identity.HttpApi.csproj" />
<PackageReference Include="Volo.Abp.TenantManagement.HttpApi" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.HttpApi\Volo.Abp.PermissionManagement.HttpApi.csproj" />
<PackageReference Include="Volo.Abp.FeatureManagement.HttpApi" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.HttpApi\Volo.Abp.TenantManagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.HttpApi\Volo.Abp.FeatureManagement.HttpApi.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

18
samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj

@ -23,9 +23,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="2.1.1" /> <PackageReference Include="Serilog.Extensions.Hosting" Version="3.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" /> <PackageReference Include="Serilog.Sinks.File" Version="4.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc4" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.1" /> <PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.1" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.0.0" /> <PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.0.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.0.0" /> <PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.0.0" />
@ -36,13 +36,13 @@
<ProjectReference Include="..\Acme.BookStore.Application\Acme.BookStore.Application.csproj" /> <ProjectReference Include="..\Acme.BookStore.Application\Acme.BookStore.Application.csproj" />
<ProjectReference Include="..\Acme.BookStore.HttpApi\Acme.BookStore.HttpApi.csproj" /> <ProjectReference Include="..\Acme.BookStore.HttpApi\Acme.BookStore.HttpApi.csproj" />
<ProjectReference Include="..\Acme.BookStore.EntityFrameworkCore.DbMigrations\Acme.BookStore.EntityFrameworkCore.DbMigrations.csproj" /> <ProjectReference Include="..\Acme.BookStore.EntityFrameworkCore.DbMigrations\Acme.BookStore.EntityFrameworkCore.DbMigrations.csproj" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
<PackageReference Include="Volo.Abp.Autofac" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Authentication.JwtBearer\Volo.Abp.AspNetCore.Authentication.JwtBearer.csproj" />
<PackageReference Include="Volo.Abp.Identity.Web" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Web\Volo.Abp.Identity.Web.csproj" />
<PackageReference Include="Volo.Abp.Account.Web.IdentityServer" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Web.IdentityServer\Volo.Abp.Account.Web.IdentityServer.csproj" />
<PackageReference Include="Volo.Abp.TenantManagement.Web" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Web\Volo.Abp.TenantManagement.Web.csproj" />
<PackageReference Include="Volo.Abp.FeatureManagement.Web" Version="0.21.0" /> <ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Web\Volo.Abp.FeatureManagement.Web.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save