Browse Source

Move all projects to generic host & remove IConfigurationAccessor usage.

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

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.Http.Client\Volo.Abp.Http.Client.csproj" />
<ProjectReference Include="..\Volo.Abp.TestBase\Volo.Abp.TestBase.csproj" />
<ProjectReference Include="..\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
</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.Net.Http;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Hosting.Server;
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.TestHost;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace Volo.Abp.AspNetCore.TestBase
{
@ -20,31 +22,36 @@ namespace Volo.Abp.AspNetCore.TestBase
protected AbpAspNetCoreIntegratedTestBase()
{
var builder = CreateWebHostBuilder();
Server = CreateTestServer(builder);
Client = Server.CreateClient();
ServiceProvider = Server.Host.Services;
var builder = CreateHostBuilder();
var host = builder.Build();
host.Start();
Server = host.GetTestServer();
Client = host.GetTestClient();
ServiceProvider = Server.Services;
ServiceProvider.GetRequiredService<ITestServerAccessor>().Server = Server;
}
protected virtual IWebHostBuilder CreateWebHostBuilder()
protected virtual IHostBuilder CreateHostBuilder()
{
return new WebHostBuilder()
.UseStartup<TStartup>()
return Host.CreateDefaultBuilder()
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<TStartup>();
webBuilder.UseTestServer();
})
.UseAutofac()
.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
/// <summary>

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 Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
using Shouldly;
using Volo.Abp.MultiTenancy;
@ -23,9 +24,9 @@ namespace Volo.Abp.AspNetCore.MultiTenancy
_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 =>
{

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 Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
using Microsoft.Net.Http.Headers;
using Shouldly;
@ -24,9 +25,9 @@ namespace Volo.Abp.AspNetCore.MultiTenancy
_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 =>
{

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

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

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

@ -1,6 +1,7 @@
using System;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Shouldly;
using Volo.Abp.Json;
using Xunit;
@ -16,7 +17,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Json
_jsonSerializer = ServiceProvider.GetRequiredService<IJsonSerializer>();
}
protected override void ConfigureServices(WebHostBuilderContext context, IServiceCollection services)
protected override void ConfigureServices(HostBuilderContext context, IServiceCollection services)
{
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 IServiceProvider ConfigureServices(IServiceCollection services)
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<AbpAspNetCoreMvcTestModule>(options =>
{
options.UseAutofac();
});
return services.BuildServiceProviderFromFactory();
services.AddApplication<AbpAspNetCoreMvcTestModule>();
}
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.Linq;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo
{
public abstract class AbpAspNetCoreMvcUiBootstrapDemoTestBase : AbpAspNetCoreTestBase<TestStartup>
{
protected override IWebHostBuilder CreateWebHostBuilder()
protected override IHostBuilder CreateHostBuilder()
{
return base.CreateWebHostBuilder()
return base.CreateHostBuilder()
.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 IServiceProvider ConfigureServices(IServiceCollection services)
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<AbpAspNetCoreMvcUiBootstrapDemoTestModule>(options =>
{
options.UseAutofac();
});
return services.BuildServiceProviderFromFactory();
services.AddApplication<AbpAspNetCoreMvcUiBootstrapDemoTestModule>();
}
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
{
Log.Information("Starting web host.");
BuildWebHostInternal(args).Build().Run();
CreateHostBuilder(args).Build().Run();
return 0;
}
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)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
.ConfigureWebHostDefaults(webBuilder =>
{
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)
{
services.AddApplication<AbpAspNetCoreMvcUiBootstrapDemoModule>(options =>
{
options.UseAutofac();
});
//return services.BuildServiceProviderFromFactory();
services.AddApplication<AbpAspNetCoreMvcUiBootstrapDemoModule>();
}
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>
<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" />
</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 IServiceProvider ConfigureServices(IServiceCollection services)
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<AbpAspNetCoreMvcUiTestModule>(options =>
{
options.UseAutofac();
});
//TODO: This is needed because ASP.NET Core does not use IServiceProviderFactory!
return services.BuildServiceProviderFromFactory();
services.AddApplication<AbpAspNetCoreMvcUiTestModule>();
}
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 IServiceProvider ConfigureServices(IServiceCollection services)
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<AbpAspNetCoreMvcVersioningTestModule>(options =>
{
options.UseAutofac();
});
//TODO: This is needed because ASP.NET Core does not use IServiceProviderFactory!
return services.BuildServiceProviderFromFactory();
services.AddApplication<AbpAspNetCoreMvcVersioningTestModule>();
}
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 IServiceProvider ConfigureServices(IServiceCollection services)
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<AbpAspNetCoreTestModule>(options =>
{
options.UseAutofac();
});
return services.BuildServiceProviderFromFactory();
services.AddApplication<AbpAspNetCoreTestModule>();
}
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 IServiceProvider ConfigureServices(IServiceCollection services)
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<AbpHttpClientTestModule>(options =>
{
options.UseAutofac();
});
//TODO: This is needed because ASP.NET Core does not use IServiceProviderFactory!
return services.BuildServiceProviderFromFactory();
services.AddApplication<AbpHttpClientTestModule>();
}
public void Configure(IApplicationBuilder app)

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

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

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

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

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

@ -12,7 +12,7 @@
</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="Swashbuckle.AspNetCore" Version="4.0.1" />
</ItemGroup>

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

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

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

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

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

@ -8,7 +8,7 @@
</PropertyGroup>
<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" />
</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.Configuration;
using Volo.Abp.DependencyInjection;
@ -9,10 +10,8 @@ namespace VoloDocs.Web.Branding
[Dependency(ReplaceServices = true)]
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"];
if (configuration["LogoUrl"] != null)

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

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

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

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

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

@ -14,7 +14,7 @@
</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="Swashbuckle.AspNetCore" Version="4.0.1" />
</ItemGroup>

4
samples/BasicAspNetCoreApplication/BasicAspNetCoreApplication/BasicAspNetCoreApplication.csproj

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

14
samples/BasicAspNetCoreApplication/BasicAspNetCoreApplication/Program.cs

@ -1,5 +1,6 @@
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
namespace BasicAspNetCoreApplication
{
@ -7,12 +8,15 @@ namespace BasicAspNetCoreApplication
{
public static void Main(string[] args)
{
BuildWebHost(args).Run();
CreateHostBuilder(args).Build().Run();
}
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.Build();
internal static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.UseAutofac();
}
}

9
samples/BasicAspNetCoreApplication/BasicAspNetCoreApplication/Startup.cs

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

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

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

4
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" />
@ -10,7 +10,7 @@
</PropertyGroup>
<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.Async" Version="1.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />

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

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

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 IServiceProvider ConfigureServices(IServiceCollection services)
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<BookStoreHttpApiHostModule>(options =>
{
options.UseAutofac();
});
return services.BuildServiceProviderFromFactory();
services.AddApplication<BookStoreHttpApiHostModule>();
}
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>
<PackageReference Include="Volo.Abp.Account.Application.Contracts" Version="0.21.0" />
<PackageReference Include="Volo.Abp.Identity.Application.Contracts" Version="0.21.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application.Contracts" Version="0.21.0" />
<PackageReference Include="Volo.Abp.TenantManagement.Application.Contracts" Version="0.21.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application.Contracts" Version="0.21.0" />
<ProjectReference Include="..\..\..\..\..\modules\account\src\Volo.Abp.Account.Application.Contracts\Volo.Abp.Account.Application.Contracts.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Application.Contracts\Volo.Abp.Identity.Application.Contracts.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.Application.Contracts\Volo.Abp.PermissionManagement.Application.Contracts.csproj" />
<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" />
<ProjectReference Include="..\..\..\modules\book-management\src\Acme.BookStore.BookManagement.Application.Contracts\Acme.BookStore.BookManagement.Application.Contracts.csproj" />
</ItemGroup>

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

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

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

@ -26,7 +26,7 @@
</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.EntityFrameworkCore.DbMigrations\Acme.BookStore.EntityFrameworkCore.DbMigrations.csproj" />
</ItemGroup>

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

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

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

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

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

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

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

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

18
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" />
@ -32,7 +32,7 @@
</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.Async" Version="1.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />
@ -45,13 +45,13 @@
<ProjectReference Include="..\Acme.BookStore.Application\Acme.BookStore.Application.csproj" />
<ProjectReference Include="..\Acme.BookStore.HttpApi\Acme.BookStore.HttpApi.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" />
<PackageReference Include="Volo.Abp.Autofac" Version="0.21.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="0.21.0" />
<PackageReference Include="Volo.Abp.Identity.Web" Version="0.21.0" />
<PackageReference Include="Volo.Abp.Account.Web.IdentityServer" Version="0.21.0" />
<PackageReference Include="Volo.Abp.TenantManagement.Web" Version="0.21.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.Web" Version="0.21.0" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Authentication.JwtBearer\Volo.Abp.AspNetCore.Authentication.JwtBearer.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Web\Volo.Abp.Identity.Web.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\account\src\Volo.Abp.Account.Web.IdentityServer\Volo.Abp.Account.Web.IdentityServer.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Web\Volo.Abp.TenantManagement.Web.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Web\Volo.Abp.FeatureManagement.Web.csproj" />
</ItemGroup>
</Project>

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

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

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

@ -8,14 +8,9 @@ namespace Acme.BookStore.Web
{
public class Startup
{
public IServiceProvider ConfigureServices(IServiceCollection services)
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<BookStoreWebModule>(options =>
{
options.UseAutofac();
});
return services.BuildServiceProviderFromFactory();
services.AddApplication<BookStoreWebModule>();
}
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>
<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" />
</ItemGroup>

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

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

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

@ -2,6 +2,7 @@
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using Shouldly;
@ -11,10 +12,10 @@ namespace Acme.BookStore
{
public abstract class BookStoreWebTestBase : AbpAspNetCoreIntegratedTestBase<BookStoreWebTestStartup>
{
protected override IWebHostBuilder CreateWebHostBuilder()
protected override IHostBuilder CreateHostBuilder()
{
return base
.CreateWebHostBuilder()
.CreateHostBuilder()
.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 IServiceProvider ConfigureServices(IServiceCollection services)
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<BookStoreWebTestModule>(options =>
{
options.UseAutofac();
});
return services.BuildServiceProviderFromFactory();
services.AddApplication<BookStoreWebTestModule>();
}
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)

16
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" />
@ -10,18 +10,18 @@
</PropertyGroup>
<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="Swashbuckle.AspNetCore" Version="4.0.1" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" 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="Volo.Abp.Autofac" Version="0.21.0" />
<PackageReference Include="Volo.Abp.AspNetCore.MultiTenancy" Version="0.21.0" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="0.21.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="0.21.0" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="0.21.0" />
<PackageReference Include="Volo.Abp.AuditLogging.EntityFrameworkCore" Version="0.21.0" />
<ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.MultiTenancy\Volo.Abp.AspNetCore.MultiTenancy.csproj" />
<ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.EntityFrameworkCore.SqlServer\Volo.Abp.EntityFrameworkCore.SqlServer.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.EntityFrameworkCore\Volo.Abp.PermissionManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.EntityFrameworkCore\Volo.Abp.SettingManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.EntityFrameworkCore\Volo.Abp.AuditLogging.EntityFrameworkCore.csproj" />
</ItemGroup>
<ItemGroup>

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

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

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 IServiceProvider ConfigureServices(IServiceCollection services)
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<BookManagementHttpApiHostModule>(options =>
{
options.UseAutofac();
});
return services.BuildServiceProviderFromFactory();
services.AddApplication<BookManagementHttpApiHostModule>();
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{
app.InitializeApplication();
}

44
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>
<TargetFramework>netcoreapp3.0</TargetFramework>
@ -8,33 +8,33 @@
</PropertyGroup>
<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="Swashbuckle.AspNetCore" Version="4.0.1" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" 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.EntityFrameworkCore.Tools" Version="3.0.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="0.21.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="0.21.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="0.21.0" />
<PackageReference Include="Volo.Abp.AspNetCore.MultiTenancy" Version="0.21.0" />
<PackageReference Include="Volo.Abp.Autofac" Version="0.21.0" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="0.21.0" />
<PackageReference Include="Volo.Abp.Account.Web.IdentityServer" Version="0.21.0" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="0.21.0" />
<PackageReference Include="Volo.Abp.AuditLogging.EntityFrameworkCore" Version="0.21.0" />
<PackageReference Include="Volo.Abp.IdentityServer.EntityFrameworkCore" Version="0.21.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="0.21.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application" Version="0.21.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi" Version="0.21.0" />
<PackageReference Include="Volo.Abp.Identity.EntityFrameworkCore" Version="0.21.0" />
<PackageReference Include="Volo.Abp.Identity.Application" Version="0.21.0" />
<PackageReference Include="Volo.Abp.Identity.HttpApi" Version="0.21.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Identity" Version="0.21.0" />
<PackageReference Include="Volo.Abp.TenantManagement.EntityFrameworkCore" Version="0.21.0" />
<PackageReference Include="Volo.Abp.TenantManagement.Application" Version="0.21.0" />
<PackageReference Include="Volo.Abp.TenantManagement.HttpApi" Version="0.21.0" />
<ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Authentication.JwtBearer\Volo.Abp.AspNetCore.Authentication.JwtBearer.csproj" />
<ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
<ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc\Volo.Abp.AspNetCore.Mvc.csproj" />
<ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.MultiTenancy\Volo.Abp.AspNetCore.MultiTenancy.csproj" />
<ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.EntityFrameworkCore.SqlServer\Volo.Abp.EntityFrameworkCore.SqlServer.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\account\src\Volo.Abp.Account.Web.IdentityServer\Volo.Abp.Account.Web.IdentityServer.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.EntityFrameworkCore\Volo.Abp.SettingManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.EntityFrameworkCore\Volo.Abp.AuditLogging.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\identityserver\src\Volo.Abp.IdentityServer.EntityFrameworkCore\Volo.Abp.IdentityServer.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.EntityFrameworkCore\Volo.Abp.PermissionManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.Application\Volo.Abp.PermissionManagement.Application.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.HttpApi\Volo.Abp.PermissionManagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.EntityFrameworkCore\Volo.Abp.Identity.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Application\Volo.Abp.Identity.Application.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.HttpApi\Volo.Abp.Identity.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\identity\src\Volo.Abp.PermissionManagement.Domain.Identity\Volo.Abp.PermissionManagement.Domain.Identity.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.EntityFrameworkCore\Volo.Abp.TenantManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Application\Volo.Abp.TenantManagement.Application.csproj" />
<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="..\Acme.BookStore.BookManagement.Host.Shared\Acme.BookStore.BookManagement.Host.Shared.csproj" />
</ItemGroup>

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

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Configuration;
using Volo.Abp.Data;
@ -21,7 +22,7 @@ namespace Acme.BookStore.BookManagement.IdentityServer
private readonly IIdentityResourceDataSeeder _identityResourceDataSeeder;
private readonly IGuidGenerator _guidGenerator;
private readonly IPermissionDataSeeder _permissionDataSeeder;
private readonly IConfigurationAccessor _configurationAccessor;
private readonly IConfiguration _configuration;
public IdentityServerDataSeedContributor(
IClientRepository clientRepository,
@ -29,14 +30,14 @@ namespace Acme.BookStore.BookManagement.IdentityServer
IIdentityResourceDataSeeder identityResourceDataSeeder,
IGuidGenerator guidGenerator,
IPermissionDataSeeder permissionDataSeeder,
IConfigurationAccessor configurationAccessor)
IConfiguration configuration)
{
_clientRepository = clientRepository;
_apiResourceRepository = apiResourceRepository;
_identityResourceDataSeeder = identityResourceDataSeeder;
_guidGenerator = guidGenerator;
_permissionDataSeeder = permissionDataSeeder;
_configurationAccessor = configurationAccessor;
_configuration = configuration;
}
[UnitOfWork]
@ -103,7 +104,7 @@ namespace Acme.BookStore.BookManagement.IdentityServer
"BookManagement"
};
var configurationSection = _configurationAccessor.Configuration.GetSection("IdentityServer:Clients");
var configurationSection = _configuration.GetSection("IdentityServer:Clients");
//Web Client
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.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Serilog;
using Serilog.Events;
@ -24,7 +25,7 @@ namespace Acme.BookStore.BookManagement
try
{
Log.Information("Starting web host.");
BuildWebHostInternal(args).Run();
CreateHostBuilder(args).Build().Run();
return 0;
}
catch (Exception ex)
@ -38,14 +39,13 @@ namespace Acme.BookStore.BookManagement
}
}
public static IWebHost BuildWebHostInternal(string[] args) =>
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup<Startup>()
.UseSerilog()
.Build();
internal static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.UseAutofac()
.UseSerilog();
}
}

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 IServiceProvider ConfigureServices(IServiceCollection services)
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<BookManagementIdentityServerModule>(options =>
{
options.UseAutofac();
});
return services.BuildServiceProviderFromFactory();
services.AddApplication<BookManagementIdentityServerModule>();
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{
app.InitializeApplication();
}

24
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" />
@ -10,22 +10,22 @@
</PropertyGroup>
<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="Swashbuckle.AspNetCore" Version="4.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" 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="Volo.Abp.Autofac" Version="0.21.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.Client" Version="0.21.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.OAuth" Version="0.21.0" />
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="0.21.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="0.21.0" />
<PackageReference Include="Volo.Abp.Identity.Web" Version="0.21.0" />
<PackageReference Include="Volo.Abp.Identity.HttpApi.Client" Version="0.21.0" />
<PackageReference Include="Volo.Abp.TenantManagement.Web" Version="0.21.0" />
<PackageReference Include="Volo.Abp.TenantManagement.HttpApi.Client" Version="0.21.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi.Client" Version="0.21.0" />
<ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.Client\Volo.Abp.AspNetCore.Mvc.Client.csproj" />
<ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Authentication.OAuth\Volo.Abp.AspNetCore.Authentication.OAuth.csproj" />
<ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.Http.Client.IdentityModel\Volo.Abp.Http.Client.IdentityModel.csproj" />
<ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Web\Volo.Abp.Identity.Web.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.HttpApi.Client\Volo.Abp.Identity.HttpApi.Client.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Web\Volo.Abp.TenantManagement.Web.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.HttpApi.Client\Volo.Abp.TenantManagement.HttpApi.Client.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.HttpApi.Client\Volo.Abp.PermissionManagement.HttpApi.Client.csproj" />
</ItemGroup>
<ItemGroup>

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

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

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 IServiceProvider ConfigureServices(IServiceCollection services)
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<BookManagementWebHostModule>(options =>
{
options.UseAutofac();
});
return services.BuildServiceProviderFromFactory();
services.AddApplication<BookManagementWebHostModule>();
}
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)

34
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" />
@ -10,25 +10,25 @@
</PropertyGroup>
<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="Swashbuckle.AspNetCore" Version="4.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0" />
<PackageReference Include="Volo.Abp.Autofac" Version="0.21.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="0.21.0" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="0.21.0" />
<PackageReference Include="Volo.Abp.AuditLogging.EntityFrameworkCore" Version="0.21.0" />
<PackageReference Include="Volo.Abp.Account.Web" Version="0.21.0" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="0.21.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application" Version="0.21.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="0.21.0" />
<PackageReference Include="Volo.Abp.Identity.Application" Version="0.21.0" />
<PackageReference Include="Volo.Abp.Identity.Web" Version="0.21.0" />
<PackageReference Include="Volo.Abp.Identity.EntityFrameworkCore" Version="0.21.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Identity" Version="0.21.0" />
<PackageReference Include="Volo.Abp.TenantManagement.Application" Version="0.21.0" />
<PackageReference Include="Volo.Abp.TenantManagement.Web" Version="0.21.0" />
<PackageReference Include="Volo.Abp.TenantManagement.EntityFrameworkCore" Version="0.21.0" />
<ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
<ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.EntityFrameworkCore.SqlServer\Volo.Abp.EntityFrameworkCore.SqlServer.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.EntityFrameworkCore\Volo.Abp.AuditLogging.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\account\src\Volo.Abp.Account.Web\Volo.Abp.Account.Web.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.EntityFrameworkCore\Volo.Abp.SettingManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.Application\Volo.Abp.PermissionManagement.Application.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.EntityFrameworkCore\Volo.Abp.PermissionManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Application\Volo.Abp.Identity.Application.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Web\Volo.Abp.Identity.Web.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.EntityFrameworkCore\Volo.Abp.Identity.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\identity\src\Volo.Abp.PermissionManagement.Domain.Identity\Volo.Abp.PermissionManagement.Domain.Identity.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Application\Volo.Abp.TenantManagement.Application.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Web\Volo.Abp.TenantManagement.Web.csproj" />
<ProjectReference Include="..\..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.EntityFrameworkCore\Volo.Abp.TenantManagement.EntityFrameworkCore.csproj" />
</ItemGroup>
<ItemGroup>

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

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

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 IServiceProvider ConfigureServices(IServiceCollection services)
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<BookManagementWebUnifiedModule>(options =>
{
options.UseAutofac();
});
return services.BuildServiceProviderFromFactory();
services.AddApplication<BookManagementWebUnifiedModule>();
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{
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" />
@ -8,7 +8,7 @@
</PropertyGroup>
<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" />
</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" />
@ -8,7 +8,7 @@
</PropertyGroup>
<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.Domain\Acme.BookStore.BookManagement.Domain.csproj" />
</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" />
@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Localization" Version="0.21.0" />
<ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.Localization\Volo.Abp.Localization.csproj" />
</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" />
@ -8,7 +8,7 @@
</PropertyGroup>
<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" />
</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" />
@ -8,7 +8,7 @@
</PropertyGroup>
<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" />
</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" />
@ -8,7 +8,7 @@
</PropertyGroup>
<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" />
</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" />
@ -8,7 +8,7 @@
</PropertyGroup>
<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" />
</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" />
@ -8,7 +8,7 @@
</PropertyGroup>
<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" />
</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" />
@ -11,8 +11,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="0.21.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared" Version="0.21.0" />
<ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.AutoMapper\Volo.Abp.AutoMapper.csproj" />
<ProjectReference Include="..\..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared\Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.csproj" />
</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>
<OutputType>Exe</OutputType>
@ -7,7 +7,7 @@
</PropertyGroup>
<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" />
</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 Acme.BookStore.BookManagement.Books;
using Acme.BookStore.BookManagement.Samples;
using Microsoft.Extensions.Configuration;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Configuration;
using Volo.Abp.DependencyInjection;
@ -15,18 +16,18 @@ namespace Acme.BookStore.BookManagement
{
private readonly ISampleAppService _sampleAppService;
private readonly IIdentityModelAuthenticationService _authenticationService;
private readonly IConfigurationAccessor _configurationAccessor;
private readonly IConfiguration _configuration;
private readonly IBookAppService _bookAppService;
public ClientDemoService(
ISampleAppService sampleAppService,
IIdentityModelAuthenticationService authenticationService,
IConfigurationAccessor configurationAccessor,
IConfiguration configuration,
IBookAppService bookAppService)
{
_sampleAppService = sampleAppService;
_authenticationService = authenticationService;
_configurationAccessor = configurationAccessor;
_configuration = configuration;
_bookAppService = bookAppService;
}
@ -71,13 +72,13 @@ namespace Acme.BookStore.BookManagement
var accessToken = await _authenticationService.GetAccessTokenAsync(
new IdentityClientConfiguration(
_configurationAccessor.Configuration["IdentityClients:Default:Authority"],
_configurationAccessor.Configuration["IdentityClients:Default:Scope"],
_configurationAccessor.Configuration["IdentityClients:Default:ClientId"],
_configurationAccessor.Configuration["IdentityClients:Default:ClientSecret"],
_configurationAccessor.Configuration["IdentityClients:Default:GrantType"],
_configurationAccessor.Configuration["IdentityClients:Default:UserName"],
_configurationAccessor.Configuration["IdentityClients:Default:UserPassword"]
_configuration["IdentityClients:Default:Authority"],
_configuration["IdentityClients:Default:Scope"],
_configuration["IdentityClients:Default:ClientId"],
_configuration["IdentityClients:Default:ClientSecret"],
_configuration["IdentityClients:Default:GrantType"],
_configuration["IdentityClients:Default:UserName"],
_configuration["IdentityClients:Default:UserPassword"]
)
);
@ -87,7 +88,7 @@ namespace Acme.BookStore.BookManagement
{
httpClient.SetBearerToken(accessToken);
var url = _configurationAccessor.Configuration["RemoteServices:BookManagement:BaseUrl"] +
var url = _configuration["RemoteServices:BookManagement:BaseUrl"] +
"api/BookManagement/sample/authorized";
var responseMessage = await httpClient.GetAsync(url);
@ -116,7 +117,7 @@ namespace Acme.BookStore.BookManagement
// discover endpoints from metadata
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)
{
Console.WriteLine(disco.Error);
@ -127,11 +128,11 @@ namespace Acme.BookStore.BookManagement
var tokenResponse = await client.RequestPasswordTokenAsync(new PasswordTokenRequest
{
Address = disco.TokenEndpoint,
ClientId = _configurationAccessor.Configuration["IdentityClients:Default:ClientId"],
ClientSecret = _configurationAccessor.Configuration["IdentityClients:Default:ClientSecret"],
UserName = _configurationAccessor.Configuration["IdentityClients:Default:UserName"],
Password = _configurationAccessor.Configuration["IdentityClients:Default:UserPassword"],
Scope = _configurationAccessor.Configuration["IdentityClients:Default:Scope"]
ClientId = _configuration["IdentityClients:Default:ClientId"],
ClientSecret = _configuration["IdentityClients:Default:ClientSecret"],
UserName = _configuration["IdentityClients:Default:UserName"],
Password = _configuration["IdentityClients:Default:UserPassword"],
Scope = _configuration["IdentityClients:Default:Scope"]
});
if (tokenResponse.IsError)
@ -148,7 +149,7 @@ namespace Acme.BookStore.BookManagement
{
httpClient.SetBearerToken(tokenResponse.AccessToken);
var url = _configurationAccessor.Configuration["RemoteServices:BookManagement:BaseUrl"] +
var url = _configuration["RemoteServices:BookManagement:BaseUrl"] +
"api/BookManagement/sample/authorized";
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>
<PackageReference Include="Volo.Abp.Identity.Application.Contracts" Version="0.21.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application.Contracts" Version="0.21.0" />
<PackageReference Include="Volo.Abp.TenantManagement.Application.Contracts" Version="0.21.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application.Contracts" Version="0.21.0" />
<ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Application.Contracts\Volo.Abp.Account.Application.Contracts.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Application.Contracts\Volo.Abp.Identity.Application.Contracts.csproj" />
<ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.Application.Contracts\Volo.Abp.PermissionManagement.Application.Contracts.csproj" />
<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>
</Project>

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

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

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

@ -29,7 +29,7 @@
</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.EntityFrameworkCore.DbMigrations\Acme.BookStore.EntityFrameworkCore.DbMigrations.csproj" />
</ItemGroup>

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -23,7 +23,7 @@
</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="Swashbuckle.AspNetCore" Version="4.0.1" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.1" />
@ -36,13 +36,13 @@
<ProjectReference Include="..\Acme.BookStore.Application\Acme.BookStore.Application.csproj" />
<ProjectReference Include="..\Acme.BookStore.HttpApi\Acme.BookStore.HttpApi.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" />
<PackageReference Include="Volo.Abp.Autofac" Version="0.21.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="0.21.0" />
<PackageReference Include="Volo.Abp.Identity.Web" Version="0.21.0" />
<PackageReference Include="Volo.Abp.Account.Web.IdentityServer" Version="0.21.0" />
<PackageReference Include="Volo.Abp.TenantManagement.Web" Version="0.21.0" />
<PackageReference Include="Volo.Abp.FeatureManagement.Web" Version="0.21.0" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Authentication.JwtBearer\Volo.Abp.AspNetCore.Authentication.JwtBearer.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Web\Volo.Abp.Identity.Web.csproj" />
<ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Web.IdentityServer\Volo.Abp.Account.Web.IdentityServer.csproj" />
<ProjectReference Include="..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Web\Volo.Abp.TenantManagement.Web.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Web\Volo.Abp.FeatureManagement.Web.csproj" />
</ItemGroup>
<ItemGroup>

20
samples/BookStore/src/Acme.BookStore.Web/Program.cs

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

9
samples/BookStore/src/Acme.BookStore.Web/Startup.cs

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

2
samples/BookStore/test/Acme.BookStore.HttpApi.Client.ConsoleTestApp/Acme.BookStore.HttpApi.Client.ConsoleTestApp.csproj

@ -17,7 +17,7 @@
</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" />
</ItemGroup>

6
samples/BookStore/test/Acme.BookStore.TestBase/Acme.BookStore.TestBase.csproj

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

2
samples/BookStore/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj

@ -17,7 +17,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<ProjectReference Include="..\Acme.BookStore.Application.Tests\Acme.BookStore.Application.Tests.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>

5
samples/BookStore/test/Acme.BookStore.Web.Tests/BookStoreWebTestBase.cs

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

9
samples/BookStore/test/Acme.BookStore.Web.Tests/BookStoreWebTestStartup.cs

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

9
samples/DashboardDemo/src/DashboardDemo.Domain/IdentityServer/IdentityServerDataSeedContributor.cs

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

2
samples/DashboardDemo/src/DashboardDemo.Web/DashboardDemo.Web.csproj

@ -31,7 +31,7 @@
</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="Swashbuckle.AspNetCore" Version="4.0.1" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.0" />

21
samples/DashboardDemo/src/DashboardDemo.Web/Program.cs

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

9
samples/DashboardDemo/src/DashboardDemo.Web/Startup.cs

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

5
samples/DashboardDemo/test/DashboardDemo.Web.Tests/DashboardDemoWebTestBase.cs

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

9
samples/DashboardDemo/test/DashboardDemo.Web.Tests/DashboardDemoWebTestStartup.cs

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

2
samples/MicroserviceDemo/applications/AuthServer.Host/AuthServer.Host.csproj

@ -12,7 +12,7 @@
</PropertyGroup>
<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.Elasticsearch" Version="6.5.0" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.0.0" />

21
samples/MicroserviceDemo/applications/AuthServer.Host/Program.cs

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

11
samples/MicroserviceDemo/applications/AuthServer.Host/Startup.cs

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

2
samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminApp.Host.csproj

@ -12,7 +12,7 @@
</PropertyGroup>
<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.Elasticsearch" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />

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

Loading…
Cancel
Save