Browse Source

Merge remote-tracking branch 'abpframework/dev' into docs

pull/3926/head
liangshiwei 6 years ago
parent
commit
d7aa11219d
  1. 7
      .gitignore
  2. 30
      abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json
  3. 4
      docs/cs/Entity-Framework-Core-PostgreSQL.md
  4. 2
      docs/cs/Getting-Started-AspNetCore-Application.md
  5. 51
      docs/en/Customizing-Application-Modules-Overriding-Services.md
  6. 3
      docs/en/Distributed-Event-Bus-RabbitMQ-Integration.md
  7. 4
      docs/en/Entity-Framework-Core-PostgreSQL.md
  8. 2
      docs/en/Getting-Started-AspNetCore-Application.md
  9. 39
      docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md
  10. 56
      docs/en/Samples/Index.md
  11. 2
      docs/en/Samples/Microservice-Demo.md
  12. 4
      docs/en/docs-nav.json
  13. 4
      docs/zh-Hans/Entity-Framework-Core-PostgreSQL.md
  14. 2
      docs/zh-Hans/Modules/Index.md
  15. 2
      docs/zh-Hans/Samples/Microservice-Demo.md
  16. 9
      framework/Volo.Abp.sln
  17. 4
      framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/CurrentUserDto.cs
  18. 16
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/SignalR/SignalRBrowserScriptContributor.cs
  19. 12
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js
  20. 10
      framework/src/Volo.Abp.AspNetCore.Mvc/Microsoft/AspNetCore/Builder/AbpAspNetCoreMvcApplicationBuilderExtensions.cs
  21. 12
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs
  22. 6
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpController.cs
  23. 5
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs
  24. 9
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/DependencyInjection/AbpAspNetCoreMvcConventionalDependencyRegistrar.cs
  25. 3
      framework/src/Volo.Abp.AspNetCore.SignalR/FodyWeavers.xml
  26. 30
      framework/src/Volo.Abp.AspNetCore.SignalR/FodyWeavers.xsd
  27. 27
      framework/src/Volo.Abp.AspNetCore.SignalR/Properties/launchSettings.json
  28. 23
      framework/src/Volo.Abp.AspNetCore.SignalR/Volo.Abp.AspNetCore.SignalR.csproj
  29. 115
      framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpAspNetCoreSignalRModule.cs
  30. 135
      framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpHub.cs
  31. 43
      framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpSignalRConventionalRegistrar.cs
  32. 14
      framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpSignalROptions.cs
  33. 21
      framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpSignalRUserIdProvider.cs
  34. 43
      framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/HubConfig.cs
  35. 33
      framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/HubRouteAttribute.cs
  36. 47
      framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Builder/AbpAspNetCoreApplicationBuilderExtensions.cs
  37. 15
      framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Routing/AbpEndpointRouterOptions.cs
  38. 18
      framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Routing/EndpointRouteBuilderContext.cs
  39. 13
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/VirtualFileSystem/WebContentFileProvider.cs
  40. 49
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs
  41. 16
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs
  42. 23
      framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/es.json
  43. 16
      framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/zh-Hant.json
  44. 8
      framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/AbpDbContextConfigurationContextPostgreSqlExtensions.cs
  45. 27
      framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/AbpDbContextOptionsPostgreSqlExtensions.cs
  46. 1
      framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj
  47. 2
      framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ObjectExtensionManager.cs
  48. 13
      framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/VirtualFiles/LocalizedTemplateContentReaderFactory.cs
  49. 2
      framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/es.json
  50. 38
      framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/es.json
  51. 3
      framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWorkManager.cs
  52. 4
      framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/es.json
  53. 2
      framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs
  54. 2
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/AbpAspNetCoreMvcUiBootstrapDemoModule.cs
  55. 2
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/AbpAspNetCoreMvcUiThemeBasicDemoModule.cs
  56. 2
      framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/AbpAspNetCoreMvcVersioningTestModule.cs
  57. 2
      framework/test/Volo.Abp.AspNetCore.Serilog.Tests/Volo/Abp/AspNetCore/App/AbpSerilogTestModule.cs
  58. 2
      framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/es.json
  59. 2
      framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/es.json
  60. 2
      framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/es.json
  61. 45
      modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/es.json
  62. 2
      modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs
  63. 12
      modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Index.cshtml
  64. 2
      modules/client-simulation/demo/Volo.ClientSimulation.Demo/ClientSimulationDemoModule.cs
  65. 2
      modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs
  66. 4
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo.Abp.IdentityServer.Domain.csproj
  67. 1
      npm/ng-packs/packages/core/src/lib/models/application-configuration.ts
  68. 2
      npm/ng-packs/packages/core/src/lib/states/config.state.ts
  69. 1
      npm/ng-packs/packages/core/src/lib/tests/config-state.service.spec.ts
  70. 1
      npm/ng-packs/packages/core/src/lib/tests/config.state.spec.ts
  71. 10
      npm/ng-packs/scripts/publish.ts
  72. 1
      npm/packs/prismjs/package.json
  73. 5
      npm/packs/signalr/abp.resourcemapping.js
  74. 12
      npm/packs/signalr/package.json
  75. 1
      nupkg/common.ps1
  76. 2
      samples/MicroserviceDemo/applications/AuthServer.Host/AuthServerHostModule.cs
  77. 2
      samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminAppHostModule.cs
  78. 2
      samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSiteHostModule.cs
  79. 2
      samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGatewayHostModule.cs
  80. 2
      samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGatewayHostModule.cs
  81. 2
      samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGatewayHostModule.cs
  82. 4
      samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingServiceHostModule.cs
  83. 4
      samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityServiceHostModule.cs
  84. 4
      samples/MicroserviceDemo/microservices/ProductService.Host/ProductServiceHostModule.cs
  85. 4
      samples/MicroserviceDemo/microservices/TenantManagementService.Host/TenantManagementServiceHostModule.cs
  86. 13
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs
  87. 2
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs
  88. 2
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs
  89. 5
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs
  90. 6
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs
  91. 2
      templates/app/aspnet-core/test/MyCompanyName.MyProjectName.Web.Tests/MyProjectNameWebTestModule.cs
  92. 12
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs
  93. 12
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs
  94. 2
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs
  95. 5
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs

7
.gitignore

@ -293,3 +293,10 @@ samples/MicroserviceDemo/applications/ConsoleClientDemo/Logs/logs.txt
modules/docs/app/Volo.DocsTestApp/Logs/logs.txt modules/docs/app/Volo.DocsTestApp/Logs/logs.txt
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Logs/logs.txt framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Logs/logs.txt
samples/MicroserviceDemo/microservices/TenantManagementService.Host/Logs/logs.txt samples/MicroserviceDemo/microservices/TenantManagementService.Host/Logs/logs.txt
/modules/client-simulation/demo/Volo.ClientSimulation.Demo/package-lock.json
/samples/BookStore/src/Acme.BookStore.Web/package-lock.json
/samples/DashboardDemo/src/DashboardDemo.Web/package-lock.json
/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/package-lock.json
/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/package-lock.json
/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/package-lock.json
/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/package-lock.json

30
abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json

@ -3,6 +3,12 @@
"texts": { "texts": {
"Permission:Organizations": "Organizations", "Permission:Organizations": "Organizations",
"Permission:Manage": "Manage Organizations", "Permission:Manage": "Manage Organizations",
"Permission:DiscountRequests": "Discount Requests",
"Permission:DiscountManage": "Manage Discount Requests",
"Permission:Disable": "Disable",
"Permission:Enable": "Enable",
"Permission:EnableSendEmail": "Enable Send Email",
"Permission:SendEmail": "Send Email",
"Permission:NpmPackages": "NPM Packages", "Permission:NpmPackages": "NPM Packages",
"Permission:NugetPackages": "Nuget Packages", "Permission:NugetPackages": "Nuget Packages",
"Permission:Maintenance": "Maintenance", "Permission:Maintenance": "Maintenance",
@ -19,6 +25,7 @@
"Menu:Organizations": "Organizations", "Menu:Organizations": "Organizations",
"Menu:Accounting": "Accounting", "Menu:Accounting": "Accounting",
"Menu:Packages": "Packages", "Menu:Packages": "Packages",
"Menu:DiscountRequests": "Discount Requests",
"NpmPackageDeletionWarningMessage": "This NPM Package will be deleted. Do you confirm that?", "NpmPackageDeletionWarningMessage": "This NPM Package will be deleted. Do you confirm that?",
"NugetPackageDeletionWarningMessage": "This Nuget Package will be deleted. Do you confirm that?", "NugetPackageDeletionWarningMessage": "This Nuget Package will be deleted. Do you confirm that?",
"ModuleDeletionWarningMessage": "This Module will be deleted. Do you confirm that?", "ModuleDeletionWarningMessage": "This Module will be deleted. Do you confirm that?",
@ -119,6 +126,27 @@
"TotalPrice": "Total Price", "TotalPrice": "Total Price",
"Generate": "Generate", "Generate": "Generate",
"MissingQuantityField": "The quantity field is required!", "MissingQuantityField": "The quantity field is required!",
"MissingPriceField": "The Price field is required!" "MissingPriceField": "The Price field is required!",
"CodeUsageStatus": "Code Usage Status",
"Country": "Country",
"DeveloperCount": "Developer Count",
"RequestCode": "Request Code",
"WebSite": "Web Site",
"GithubUsername": "Github Username",
"PhoneNumber": "Phone Number",
"ProjectDescription": "Project Description",
"Referrer": "Referrer",
"DiscountRequests": "Discount Request",
"Copylink": "Copy Link",
"Disable": "Disable",
"Enable": "Enable",
"EnableSendEmail": "Enable Send Email",
"SendEmail": "Send Email",
"SuccessfullyDisabled": "Successfully Disabled",
"SuccessfullyEnabled": "Successfully Enabled",
"EmailSent": "Email Sent",
"SuccessfullySent": "Successfully Sent",
"SuccessfullyDeleted": "Successfully Deleted",
"DiscountRequestDeletionWarningMessage": "Discount request will be deleted"
} }
} }

4
docs/cs/Entity-Framework-Core-PostgreSQL.md

@ -10,9 +10,9 @@ Projekt `.EntityFrameworkCore` v řešení závisí na NuGet balíku [Volo.Abp.E
Najděte třídu ***YourProjectName*EntityFrameworkCoreModule** v projektu `.EntityFrameworkCore`, odstraňte `typeof(AbpEntityFrameworkCoreSqlServerModule)` z atributu `DependsOn`, přidejte `typeof(AbpEntityFrameworkCorePostgreSqlModule)` (také nahraďte `using Volo.Abp.EntityFrameworkCore.SqlServer;` za `using Volo.Abp.EntityFrameworkCore.PostgreSql;`). Najděte třídu ***YourProjectName*EntityFrameworkCoreModule** v projektu `.EntityFrameworkCore`, odstraňte `typeof(AbpEntityFrameworkCoreSqlServerModule)` z atributu `DependsOn`, přidejte `typeof(AbpEntityFrameworkCorePostgreSqlModule)` (také nahraďte `using Volo.Abp.EntityFrameworkCore.SqlServer;` za `using Volo.Abp.EntityFrameworkCore.PostgreSql;`).
## UsePostgreSql() ## UseNpgsql()
Najděte volání `UseSqlServer()` v *YourProjectName*EntityFrameworkCoreModule.cs uvnitř projektu `.EntityFrameworkCore` a nahraďte za `UsePostgreSql()`. Najděte volání `UseSqlServer()` v *YourProjectName*EntityFrameworkCoreModule.cs uvnitř projektu `.EntityFrameworkCore` a nahraďte za `UseNpgsql()`.
Najděte volání `UseSqlServer()` v *YourProjectName*MigrationsDbContextFactory.cs uvnitř projektu `.EntityFrameworkCore.DbMigrations` a nahraďte za `UseNpgsql()`. Najděte volání `UseSqlServer()` v *YourProjectName*MigrationsDbContextFactory.cs uvnitř projektu `.EntityFrameworkCore.DbMigrations` a nahraďte za `UseNpgsql()`.

2
docs/cs/Getting-Started-AspNetCore-Application.md

@ -57,7 +57,7 @@ namespace BasicAspNetCoreApplication
app.UseStaticFiles(); app.UseStaticFiles();
app.UseRouting(); app.UseRouting();
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
} }
} }
} }

51
docs/en/Customizing-Application-Modules-Overriding-Services.md

@ -106,30 +106,33 @@ You could completely **re-write** the entire business logic for a user creation
[ExposeServices(typeof(IdentityUserManager))] [ExposeServices(typeof(IdentityUserManager))]
public class MyIdentityUserManager : IdentityUserManager public class MyIdentityUserManager : IdentityUserManager
{ {
public MyIdentityUserManager( public MyIdentityUserManager(
IdentityUserStore store, IdentityUserStore store,
IOptions<IdentityOptions> optionsAccessor, IIdentityRoleRepository roleRepository,
IPasswordHasher<IdentityUser> passwordHasher, IIdentityUserRepository userRepository,
IEnumerable<IUserValidator<IdentityUser>> userValidators, IOptions<IdentityOptions> optionsAccessor,
IEnumerable<IPasswordValidator<IdentityUser>> passwordValidators, IPasswordHasher<IdentityUser> passwordHasher,
ILookupNormalizer keyNormalizer, IEnumerable<IUserValidator<IdentityUser>> userValidators,
IdentityErrorDescriber errors, IEnumerable<IPasswordValidator<IdentityUser>> passwordValidators,
IServiceProvider services, ILookupNormalizer keyNormalizer,
ILogger<IdentityUserManager> logger, IdentityErrorDescriber errors,
ICancellationTokenProvider cancellationTokenProvider IServiceProvider services,
) : base( ILogger<IdentityUserManager> logger,
store, ICancellationTokenProvider cancellationTokenProvider) :
optionsAccessor, base(store,
passwordHasher, roleRepository,
userValidators, userRepository,
passwordValidators, optionsAccessor,
keyNormalizer, passwordHasher,
errors, userValidators,
services, passwordValidators,
logger, keyNormalizer,
cancellationTokenProvider) errors,
{ services,
} logger,
cancellationTokenProvider)
{
}
public override async Task<IdentityResult> CreateAsync(IdentityUser user) public override async Task<IdentityResult> CreateAsync(IdentityUser user)
{ {

3
docs/en/Distributed-Event-Bus-RabbitMQ-Integration.md

@ -0,0 +1,3 @@
# Distributed Event Bus RabbitMQ Integration
TODO

4
docs/en/Entity-Framework-Core-PostgreSQL.md

@ -10,9 +10,9 @@ This document explains how to switch to the **PostgreSQL** database provider for
Find ***YourProjectName*EntityFrameworkCoreModule** class inside the `.EntityFrameworkCore` project, remove `typeof(AbpEntityFrameworkCoreSqlServerModule)` from the `DependsOn` attribute, add `typeof(AbpEntityFrameworkCorePostgreSqlModule)` (also replace `using Volo.Abp.EntityFrameworkCore.SqlServer;` with `using Volo.Abp.EntityFrameworkCore.PostgreSql;`). Find ***YourProjectName*EntityFrameworkCoreModule** class inside the `.EntityFrameworkCore` project, remove `typeof(AbpEntityFrameworkCoreSqlServerModule)` from the `DependsOn` attribute, add `typeof(AbpEntityFrameworkCorePostgreSqlModule)` (also replace `using Volo.Abp.EntityFrameworkCore.SqlServer;` with `using Volo.Abp.EntityFrameworkCore.PostgreSql;`).
## UsePostgreSql() ## UseNpgsql()
Find `UseSqlServer()` call in *YourProjectName*EntityFrameworkCoreModule.cs inside the `.EntityFrameworkCore` project and replace with `UsePostgreSql()`. Find `UseSqlServer()` call in *YourProjectName*EntityFrameworkCoreModule.cs inside the `.EntityFrameworkCore` project and replace with `UseNpgsql()`.
Find `UseSqlServer()` call in *YourProjectName*MigrationsDbContextFactory.cs inside the `.EntityFrameworkCore.DbMigrations` project and replace with `UseNpgsql()`. Find `UseSqlServer()` call in *YourProjectName*MigrationsDbContextFactory.cs inside the `.EntityFrameworkCore.DbMigrations` project and replace with `UseNpgsql()`.

2
docs/en/Getting-Started-AspNetCore-Application.md

@ -57,7 +57,7 @@ namespace BasicAspNetCoreApplication
app.UseStaticFiles(); app.UseStaticFiles();
app.UseRouting(); app.UseRouting();
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
} }
} }
} }

39
docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md

@ -158,6 +158,17 @@ You can find the source code of the completed example [here](https://github.com/
```` ````
* Help! I am getting ***System.ArgumentNullException: Value cannot be null. (Parameter 'userName')*** error!
* This occurs when you use Azure Authority **v2.0 endpoint** without requesting `email` scope. [Abp checks unique email to create user](https://github.com/abpframework/abp/blob/037ef9abe024c03c1f89ab6c933710bcfe3f5c93/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs#L208). Simply add
````csharp
options.Scope.Add("email");
````
to your openid configuration.
* Help! I keep getting ***AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application*** error! * Help! I keep getting ***AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application*** error!
* If you set your **CallbackPath** in appsettings as: * If you set your **CallbackPath** in appsettings as:
@ -169,18 +180,19 @@ You can find the source code of the completed example [here](https://github.com/
} }
```` ````
your **Redirect URI** of your application in azure portal must be with <u>domain</u> like `https://localhost:44320/signin-azuread-oidc`, not only `/signin-azuread-oidc`. your **Redirect URI** of your application in azure portal must be <u>with domain</u> like `https://localhost:44320/signin-azuread-oidc`, not only `/signin-azuread-oidc`.
* Help! I keep getting ***AADSTS700051: The response_type 'token' is not enabled for the application.*** error!
* Help! I am getting ***System.ArgumentNullException: Value cannot be null. (Parameter 'userName')*** error! * This error occurs when you request **token** (access token) along with **id_token** without enabling Access tokens on Azure portal app registrations. Simply tick **Access tokens** checkbox located on top of ID tokens to be able to request token aswell.
* Help! I keep getting ***AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret*** error!
* This occurs when you use Azure Authority **v2.0 endpoint** without requesting `email` scope. [Abp checks unique email to create user](https://github.com/abpframework/abp/blob/037ef9abe024c03c1f89ab6c933710bcfe3f5c93/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs#L208). Simply add * This error occurs when you request **code** along with **id_token**. You need to add **client secret** on azure portal app registrations, under **Certificates & secrets** menu. Afterwards, you need to add openid configuration option like:
````csharp ````csharp
options.Scope.Add("email"); options.ClientSecret = "Value of your secret on azure portal";
```` ````
to your openid configuration.
* How can I **debug/watch** which claims I get before they get mapped? * How can I **debug/watch** which claims I get before they get mapped?
@ -188,13 +200,12 @@ You can find the source code of the completed example [here](https://github.com/
````csharp ````csharp
options.Events.OnTokenValidated = (async context => options.Events.OnTokenValidated = (async context =>
{ {
var claimsFromOidcProvider = context.Principal.Claims.ToList(); var claimsFromOidcProvider = context.Principal.Claims.ToList();
await Task.CompletedTask; await Task.CompletedTask;
}); });
```` ````
## See Also ## See Also
* [How to Customize the Login Page for MVC / Razor Page Applications](Customize-Login-Page-MVC.md). * [How to Customize the Login Page for MVC / Razor Page Applications](Customize-Login-Page-MVC.md).

56
docs/en/Samples/Index.md

@ -0,0 +1,56 @@
# Sample Applications
Here, a list of official samples built with the ABP Framework. Most of these samples are located under the [abpframework/abp-samples](https://github.com/abpframework/abp-samples) GitHub repository.
### Microservice Demo
A complete solution to demonstrate how to build systems based on the microservice architecture.
* [The complete documentation for this sample](Microservice-Demo.md)
* [Source code](https://github.com/abpframework/abp/tree/dev/samples/MicroserviceDemo)
* [Microservice architecture document](../Microservice-Architecture.md)
### Book Store
A simple CRUD application to show basic principles of developing an application with the ABP Framework. The same sample was implemented with different technologies:
* **Book Store: Razor Pages UI & Entity Framework Core**
* [Tutorial](https://docs.abp.io/en/abp/latest/Tutorials/Part-1?UI=MVC)
* [Source code](https://github.com/abpframework/abp-samples/tree/master/BookStore)
* **Book Store: Angular UI & MongoDB**
* [Tutorial](https://docs.abp.io/en/abp/latest/Tutorials/Part-1?UI=NG)
* [Source code](https://github.com/abpframework/abp-samples/tree/master/BookStore-Angular-MongoDb)
* **Book Store: Modular application (Razor Pages UI & EF Core)**
* [Source code](https://github.com/abpframework/abp-samples/tree/master/BookStore-Modular)
While there is no Razor Pages & MongoDB combination, you can check both documents to understand it since DB & UI selection don't effect each other.
### Other Samples
* **Entity Framework Migrations**: A solution to demonstrate how to split your application into multiple databases each database contains different modules.
* [Source code](https://github.com/abpframework/abp-samples/tree/master/DashboardDemo)
* [EF Core database migrations document](../Entity-Framework-Core-Migrations.md)
* **Dashboard Demo**: A simple application to show how to use the widget system for the ASP.NET Core MVC UI.
* [Source code](https://github.com/abpframework/abp-samples/tree/master/DashboardDemo)
* [Widget documentation](../UI/AspNetCore/Widgets.md)
* **RabbitMQ Event Bus Demo**: A solution consists of two applications communicating to each other via distributed events with RabbitMQ integration.
* [Source code](https://github.com/abpframework/abp-samples/tree/master/RabbitMqEventBus)
* [Distributed event bus document](../Distributed-Event-Bus.md)
* [RabbitMQ distributed event bus integration document](../Distributed-Event-Bus-RabbitMQ-Integration.md)
* **Authentication Customization**: A solution to show how to customize the authentication for ASP.NET Core MVC / Razor Pages applications.
* [Source code](https://github.com/abpframework/abp-samples/tree/master/aspnet-core/Authentication-Customization)
* Related "[How To](../How-To/Index.md)" documents:
* [Azure Active Directory Authentication](../How-To/Azure-Active-Directory-Authentication-MVC.md)
* [Customize the Login Page](../How-To/Customize-Login-Page-MVC.md)
* [Customize the SignIn Manager](../How-To/Customize-SignIn-Manager.md)
* **Empty ASP.NET Core Application**: The most basic ASP.NET Core application with the ABP Framework installed.
* [Source code](https://github.com/abpframework/abp-samples/tree/master/BasicAspNetCoreApplication)
* [Documentation](../Getting-Started-AspNetCore-Application.md)
* **Empty Console Application**: The most basic console application with the ABP Framework installed.
* [Source code](https://github.com/abpframework/abp-samples/tree/master/BasicConsoleApplication)
* [Documentation](../Getting-Started-Console-Application.md)

2
docs/en/Samples/Microservice-Demo.md

@ -552,7 +552,7 @@ app.MapWhen(ctx => ctx.Request.Path.ToString().StartsWith("/api/abp/") ||
ctx.Request.Path.ToString().StartsWith("/Abp/"), ctx.Request.Path.ToString().StartsWith("/Abp/"),
app2 => app2 =>
{ {
app2.UseMvcWithDefaultRouteAndArea(); app2.UseConfiguredEndpoints();
}); });
app.UseOcelot().Wait(); app.UseOcelot().Wait();

4
docs/en/docs-nav.json

@ -505,6 +505,10 @@
{ {
"text": "Samples", "text": "Samples",
"items": [ "items": [
{
"text": "All Samples",
"path": "Samples/Index.md"
},
{ {
"text": "Microservice Demo", "text": "Microservice Demo",
"path": "Samples/Microservice-Demo.md" "path": "Samples/Microservice-Demo.md"

4
docs/zh-Hans/Entity-Framework-Core-PostgreSQL.md

@ -10,9 +10,9 @@
在 `.EntityFrameworkCore` 项目中找到 **YourProjectName*EntityFrameworkCoreModule** 类, 删除 `DependsOn` attribute 上的`typeof(AbpEntityFrameworkCoreSqlServerModule)`, 添加 `typeof(AbpEntityFrameworkCorePostgreSqlModule)` (或者替换 `using Volo.Abp.EntityFrameworkCore.SqlServer;` 为 `using Volo.Abp.EntityFrameworkCore.PostgreSql;`). 在 `.EntityFrameworkCore` 项目中找到 **YourProjectName*EntityFrameworkCoreModule** 类, 删除 `DependsOn` attribute 上的`typeof(AbpEntityFrameworkCoreSqlServerModule)`, 添加 `typeof(AbpEntityFrameworkCorePostgreSqlModule)` (或者替换 `using Volo.Abp.EntityFrameworkCore.SqlServer;` 为 `using Volo.Abp.EntityFrameworkCore.PostgreSql;`).
## UsePostgreSql() ## UseNpgsql()
查找你的解决方案中 `UseSqlServer()`调用,替换为 `UsePostgreSql()`. 检查下列文件: 查找你的解决方案中 `UseSqlServer()`调用,替换为 `UseNpgsql()`. 检查下列文件:
* `.EntityFrameworkCore` 项目中的*YourProjectName*EntityFrameworkCoreModule.cs. * `.EntityFrameworkCore` 项目中的*YourProjectName*EntityFrameworkCoreModule.cs.
* `.EntityFrameworkCore` 项目中的*YourProjectName*MigrationsDbContextFactory.cs. * `.EntityFrameworkCore` 项目中的*YourProjectName*MigrationsDbContextFactory.cs.

2
docs/zh-Hans/Modules/Index.md

@ -28,4 +28,4 @@ ABP是一个 **模块化的应用程序框架** 由十多个 **nuget packages**
## 商业应用模块 ## 商业应用模块
[ABP商业](https://commercial.abp.io/)许可证在ABP框架上提供了额外的预构建应用程序模块. 参见ABP商业版提供的[模块列表](https://commercial.abp.io/module). [ABP商业](https://commercial.abp.io/)许可证在ABP框架上提供了额外的预构建应用程序模块. 参见ABP商业版提供的[模块列表](https://commercial.abp.io/modules).

2
docs/zh-Hans/Samples/Microservice-Demo.md

@ -553,7 +553,7 @@ app.MapWhen(ctx => ctx.Request.Path.ToString().StartsWith("/api/abp/") ||
ctx.Request.Path.ToString().StartsWith("/Abp/"), ctx.Request.Path.ToString().StartsWith("/Abp/"),
app2 => app2 =>
{ {
app2.UseMvcWithDefaultRouteAndArea(); app2.UseConfiguredEndpoints();
}); });
app.UseOcelot().Wait(); app.UseOcelot().Wait();

9
framework/Volo.Abp.sln

@ -283,7 +283,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.TextTemplating", "
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.TextTemplating.Tests", "test\Volo.Abp.TextTemplating.Tests\Volo.Abp.TextTemplating.Tests.csproj", "{251C7FD3-D313-4BCE-8068-352EC7EEA275}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.TextTemplating.Tests", "test\Volo.Abp.TextTemplating.Tests\Volo.Abp.TextTemplating.Tests.csproj", "{251C7FD3-D313-4BCE-8068-352EC7EEA275}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Validation.Abstractions", "src\Volo.Abp.Validation.Abstractions\Volo.Abp.Validation.Abstractions.csproj", "{FA5D1D6A-2A05-4A3D-99C1-2B6C1D1F99A3}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Validation.Abstractions", "src\Volo.Abp.Validation.Abstractions\Volo.Abp.Validation.Abstractions.csproj", "{FA5D1D6A-2A05-4A3D-99C1-2B6C1D1F99A3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.SignalR", "src\Volo.Abp.AspNetCore.SignalR\Volo.Abp.AspNetCore.SignalR.csproj", "{B64FCE08-E9D2-4984-BF12-FE199F257416}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -847,6 +849,10 @@ Global
{FA5D1D6A-2A05-4A3D-99C1-2B6C1D1F99A3}.Debug|Any CPU.Build.0 = Debug|Any CPU {FA5D1D6A-2A05-4A3D-99C1-2B6C1D1F99A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FA5D1D6A-2A05-4A3D-99C1-2B6C1D1F99A3}.Release|Any CPU.ActiveCfg = Release|Any CPU {FA5D1D6A-2A05-4A3D-99C1-2B6C1D1F99A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FA5D1D6A-2A05-4A3D-99C1-2B6C1D1F99A3}.Release|Any CPU.Build.0 = Release|Any CPU {FA5D1D6A-2A05-4A3D-99C1-2B6C1D1F99A3}.Release|Any CPU.Build.0 = Release|Any CPU
{B64FCE08-E9D2-4984-BF12-FE199F257416}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B64FCE08-E9D2-4984-BF12-FE199F257416}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B64FCE08-E9D2-4984-BF12-FE199F257416}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B64FCE08-E9D2-4984-BF12-FE199F257416}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -991,6 +997,7 @@ Global
{9E53F91F-EACD-4191-A487-E727741F1311} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} {9E53F91F-EACD-4191-A487-E727741F1311} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{251C7FD3-D313-4BCE-8068-352EC7EEA275} = {447C8A77-E5F0-4538-8687-7383196D04EA} {251C7FD3-D313-4BCE-8068-352EC7EEA275} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{FA5D1D6A-2A05-4A3D-99C1-2B6C1D1F99A3} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} {FA5D1D6A-2A05-4A3D-99C1-2B6C1D1F99A3} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{B64FCE08-E9D2-4984-BF12-FE199F257416} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BB97ECF4-9A84-433F-A80B-2A3285BDD1D5} SolutionGuid = {BB97ECF4-9A84-433F-A80B-2A3285BDD1D5}

4
framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/CurrentUserDto.cs

@ -12,5 +12,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
public Guid? TenantId { get; set; } public Guid? TenantId { get; set; }
public string UserName { get; set; } public string UserName { get; set; }
public string Email { get; set; }
} }
} }

16
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/SignalR/SignalRBrowserScriptContributor.cs

@ -0,0 +1,16 @@
using System.Collections.Generic;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Core;
using Volo.Abp.Modularity;
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.SignalR
{
[DependsOn(typeof(CoreScriptContributor))]
public class SignalRBrowserScriptContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.AddIfNotContains("/libs/signalr/browser/signalr.js");
}
}
}

12
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js

@ -1,4 +1,4 @@
/** /**
* TODO: Document & prepare typescript definitions * TODO: Document & prepare typescript definitions
* TODO: Refactor & test more * TODO: Refactor & test more
*/ */
@ -49,6 +49,7 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f
var _publicApi = null; var _publicApi = null;
var _args = null; var _args = null;
var _onOpenCallbacks = new CallbackList();
var _onCloseCallbacks = new CallbackList(); var _onCloseCallbacks = new CallbackList();
var _onResultCallbacks = new CallbackList(); var _onResultCallbacks = new CallbackList();
@ -106,6 +107,7 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f
} }
$firstVisibleInput.focus(); $firstVisibleInput.focus();
_onOpenCallbacks.triggerAll(_publicApi);
}); });
var modalClass = abp.modals[options.modalClass]; var modalClass = abp.modals[options.modalClass];
@ -147,6 +149,10 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f
_$modal.modal('hide'); _$modal.modal('hide');
}; };
var _onOpen = function (onOpenCallback) {
_onOpenCallbacks.add(onOpenCallback);
};
var _onClose = function (onCloseCallback) { var _onClose = function (onCloseCallback) {
_onCloseCallbacks.add(onCloseCallback); _onCloseCallbacks.add(onCloseCallback);
}; };
@ -188,6 +194,8 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f
_onResultCallbacks.triggerAll(_publicApi, arguments); _onResultCallbacks.triggerAll(_publicApi, arguments);
}, },
onOpen: _onOpen,
onClose: _onClose, onClose: _onClose,
onResult: _onResult onResult: _onResult
@ -198,4 +206,4 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f
}; };
})(); })();
})(jQuery); })(jQuery);

10
framework/src/Volo.Abp.AspNetCore.Mvc/Microsoft/AspNetCore/Builder/AbpAspNetCoreMvcApplicationBuilderExtensions.cs

@ -15,18 +15,12 @@ namespace Microsoft.AspNetCore.Builder
/// <param name="app">The <see cref="T:Microsoft.AspNetCore.Builder.IApplicationBuilder" />.</param> /// <param name="app">The <see cref="T:Microsoft.AspNetCore.Builder.IApplicationBuilder" />.</param>
/// <param name="additionalConfigurationAction">Additional action to configure routes</param> /// <param name="additionalConfigurationAction">Additional action to configure routes</param>
/// <returns>A reference to this instance after the operation has completed.</returns> /// <returns>A reference to this instance after the operation has completed.</returns>
[Obsolete("Use app.UseConfiguredEndpoints(...) extension method instead!")]
public static IApplicationBuilder UseMvcWithDefaultRouteAndArea( public static IApplicationBuilder UseMvcWithDefaultRouteAndArea(
this IApplicationBuilder app, this IApplicationBuilder app,
Action<IEndpointRouteBuilder> additionalConfigurationAction = null) Action<IEndpointRouteBuilder> additionalConfigurationAction = null)
{ {
return app.UseEndpoints(endpoints => return app.UseConfiguredEndpoints(additionalConfigurationAction);
{
endpoints.MapControllerRoute("defaultWithArea", "{area}/{controller=Home}/{action=Index}/{id?}");
endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}");
endpoints.MapRazorPages();
additionalConfigurationAction?.Invoke(endpoints);
});
} }
} }
} }

12
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs

@ -13,10 +13,12 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using System.Reflection; using System.Reflection;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Mvc.ApiExplorer; using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Microsoft.AspNetCore.Mvc.Razor; using Microsoft.AspNetCore.Mvc.Razor;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure; using Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Localization; using Microsoft.Extensions.Localization;
using Volo.Abp.ApiVersioning; using Volo.Abp.ApiVersioning;
@ -165,6 +167,16 @@ namespace Volo.Abp.AspNetCore.Mvc
{ {
mvcOptions.AddAbp(context.Services); mvcOptions.AddAbp(context.Services);
}); });
Configure<AbpEndpointRouterOptions>(options =>
{
options.EndpointConfigureActions.Add(context =>
{
context.Endpoints.MapControllerRoute("defaultWithArea", "{area}/{controller=Home}/{action=Index}/{id?}");
context.Endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}");
context.Endpoints.MapRazorPages();
});
});
} }
public override void OnApplicationInitialization(ApplicationInitializationContext context) public override void OnApplicationInitialization(ApplicationInitializationContext context)

6
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpController.cs

@ -75,6 +75,9 @@ namespace Volo.Abp.AspNetCore.Mvc
public ILoggerFactory LoggerFactory => LazyGetRequiredService(ref _loggerFactory); public ILoggerFactory LoggerFactory => LazyGetRequiredService(ref _loggerFactory);
private ILoggerFactory _loggerFactory; private ILoggerFactory _loggerFactory;
protected ILogger Logger => _lazyLogger.Value;
private Lazy<ILogger> _lazyLogger => new Lazy<ILogger>(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true);
public ICurrentUser CurrentUser => LazyGetRequiredService(ref _currentUser); public ICurrentUser CurrentUser => LazyGetRequiredService(ref _currentUser);
private ICurrentUser _currentUser; private ICurrentUser _currentUser;
@ -118,8 +121,5 @@ namespace Volo.Abp.AspNetCore.Mvc
{ {
ModelValidator?.Validate(ModelState); ModelValidator?.Validate(ModelState);
} }
protected ILogger Logger => _lazyLogger.Value;
private Lazy<ILogger> _lazyLogger => new Lazy<ILogger>(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true);
} }
} }

5
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs

@ -107,7 +107,8 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
IsAuthenticated = _currentUser.IsAuthenticated, IsAuthenticated = _currentUser.IsAuthenticated,
Id = _currentUser.Id, Id = _currentUser.Id,
TenantId = _currentUser.TenantId, TenantId = _currentUser.TenantId,
UserName = _currentUser.UserName UserName = _currentUser.UserName,
Email = _currentUser.Email
}; };
} }
@ -226,4 +227,4 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
return result; return result;
} }
} }
} }

9
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/DependencyInjection/AbpAspNetCoreMvcConventionalDependencyRegistrar.cs

@ -29,8 +29,13 @@ namespace Volo.Abp.AspNetCore.Mvc.DependencyInjection
foreach (var serviceType in serviceTypes) foreach (var serviceType in serviceTypes)
{ {
var serviceDescriptor = ServiceDescriptor.Describe(serviceType, type, lifeTime); services.Add(
services.Add(serviceDescriptor); ServiceDescriptor.Describe(
serviceType,
type,
lifeTime
)
);
} }
} }

3
framework/src/Volo.Abp.AspNetCore.SignalR/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
framework/src/Volo.Abp.AspNetCore.SignalR/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

27
framework/src/Volo.Abp.AspNetCore.SignalR/Properties/launchSettings.json

@ -0,0 +1,27 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:53900/",
"sslPort": 44362
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Volo.Abp.SignalR": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:5001;http://localhost:5000"
}
}
}

23
framework/src/Volo.Abp.AspNetCore.SignalR/Volo.Abp.AspNetCore.SignalR.csproj

@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyName>Volo.Abp.AspNetCore.SignalR</AssemblyName>
<PackageId>Volo.Abp.AspNetCore.SignalR</PackageId>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<IsPackable>true</IsPackable>
<OutputType>Library</OutputType>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.AspNetCore\Volo.Abp.AspNetCore.csproj" />
</ItemGroup>
</Project>

115
framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpAspNetCoreSignalRModule.cs

@ -0,0 +1,115 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http.Connections;
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Volo.Abp.Modularity;
namespace Volo.Abp.AspNetCore.SignalR
{
[DependsOn(
typeof(AbpAspNetCoreModule)
)]
public class AbpAspNetCoreSignalRModule : AbpModule
{
private static readonly MethodInfo MapHubGenericMethodInfo =
typeof(AbpAspNetCoreSignalRModule)
.GetMethod("MapHub", BindingFlags.Static | BindingFlags.NonPublic);
public override void PreConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddConventionalRegistrar(new AbpSignalRConventionalRegistrar());
AutoAddHubTypes(context.Services);
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddSignalR();
Configure<AbpEndpointRouterOptions>(options =>
{
options.EndpointConfigureActions.Add(endpointContext =>
{
var signalROptions = endpointContext
.ScopeServiceProvider
.GetRequiredService<IOptions<AbpSignalROptions>>()
.Value;
foreach (var hubConfig in signalROptions.Hubs)
{
MapHubType(
hubConfig.HubType,
endpointContext.Endpoints,
hubConfig.RoutePattern,
opts =>
{
foreach (var configureAction in hubConfig.ConfigureActions)
{
configureAction(opts);
}
}
);
}
});
});
}
private void AutoAddHubTypes(IServiceCollection services)
{
var hubTypes = new List<Type>();
services.OnRegistred(context =>
{
if (typeof(Hub).IsAssignableFrom(context.ImplementationType))
{
hubTypes.Add(context.ImplementationType);
}
});
services.Configure<AbpSignalROptions>(options =>
{
foreach (var hubType in hubTypes)
{
options.Hubs.Add(HubConfig.Create(hubType));
}
});
}
private void MapHubType(
Type hubType,
IEndpointRouteBuilder endpoints,
string pattern,
Action<HttpConnectionDispatcherOptions> configureOptions)
{
MapHubGenericMethodInfo
.MakeGenericMethod(hubType)
.Invoke(
this,
new object[]
{
endpoints,
pattern,
configureOptions
}
);
}
// ReSharper disable once UnusedMember.Local (used via reflection)
private static void MapHub<THub>(
IEndpointRouteBuilder endpoints,
string pattern,
Action<HttpConnectionDispatcherOptions> configureOptions)
where THub : Hub
{
endpoints.MapHub<THub>(
pattern,
configureOptions
);
}
}
}

135
framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpHub.cs

@ -0,0 +1,135 @@
using System;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Volo.Abp.Localization;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Timing;
using Volo.Abp.Users;
namespace Volo.Abp.AspNetCore.SignalR
{
public abstract class AbpHub : Hub
{
public IServiceProvider ServiceProvider { get; set; }
protected readonly object ServiceProviderLock = new object();
protected TService LazyGetRequiredService<TService>(ref TService reference)
=> LazyGetRequiredService(typeof(TService), ref reference);
protected TRef LazyGetRequiredService<TRef>(Type serviceType, ref TRef reference)
{
if (reference == null)
{
lock (ServiceProviderLock)
{
if (reference == null)
{
reference = (TRef)ServiceProvider.GetRequiredService(serviceType);
}
}
}
return reference;
}
public ILoggerFactory LoggerFactory => LazyGetRequiredService(ref _loggerFactory);
private ILoggerFactory _loggerFactory;
protected ILogger Logger => _lazyLogger.Value;
private Lazy<ILogger> _lazyLogger => new Lazy<ILogger>(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true);
public ICurrentUser CurrentUser => LazyGetRequiredService(ref _currentUser);
private ICurrentUser _currentUser;
public ICurrentTenant CurrentTenant => LazyGetRequiredService(ref _currentTenant);
private ICurrentTenant _currentTenant;
public IAuthorizationService AuthorizationService => LazyGetRequiredService(ref _authorizationService);
private IAuthorizationService _authorizationService;
public IClock Clock => LazyGetRequiredService(ref _clock);
private IClock _clock;
public IStringLocalizerFactory StringLocalizerFactory => LazyGetRequiredService(ref _stringLocalizerFactory);
private IStringLocalizerFactory _stringLocalizerFactory;
public IStringLocalizer L => _localizer ?? (_localizer = StringLocalizerFactory.Create(LocalizationResource));
private IStringLocalizer _localizer;
protected Type LocalizationResource
{
get => _localizationResource;
set
{
_localizationResource = value;
_localizer = null;
}
}
private Type _localizationResource = typeof(DefaultResource);
}
public abstract class AbpHub<T> : Hub<T>
where T : class
{
public IServiceProvider ServiceProvider { get; set; }
protected readonly object ServiceProviderLock = new object();
protected TService LazyGetRequiredService<TService>(ref TService reference)
=> LazyGetRequiredService(typeof(TService), ref reference);
protected TRef LazyGetRequiredService<TRef>(Type serviceType, ref TRef reference)
{
if (reference == null)
{
lock (ServiceProviderLock)
{
if (reference == null)
{
reference = (TRef)ServiceProvider.GetRequiredService(serviceType);
}
}
}
return reference;
}
public ILoggerFactory LoggerFactory => LazyGetRequiredService(ref _loggerFactory);
private ILoggerFactory _loggerFactory;
protected ILogger Logger => _lazyLogger.Value;
private Lazy<ILogger> _lazyLogger => new Lazy<ILogger>(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true);
public ICurrentUser CurrentUser => LazyGetRequiredService(ref _currentUser);
private ICurrentUser _currentUser;
public ICurrentTenant CurrentTenant => LazyGetRequiredService(ref _currentTenant);
private ICurrentTenant _currentTenant;
public IAuthorizationService AuthorizationService => LazyGetRequiredService(ref _authorizationService);
private IAuthorizationService _authorizationService;
public IClock Clock => LazyGetRequiredService(ref _clock);
private IClock _clock;
public IStringLocalizerFactory StringLocalizerFactory => LazyGetRequiredService(ref _stringLocalizerFactory);
private IStringLocalizerFactory _stringLocalizerFactory;
public IStringLocalizer L => _localizer ?? (_localizer = StringLocalizerFactory.Create(LocalizationResource));
private IStringLocalizer _localizer;
protected Type LocalizationResource
{
get => _localizationResource;
set
{
_localizationResource = value;
_localizer = null;
}
}
private Type _localizationResource = typeof(DefaultResource);
}
}

43
framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpSignalRConventionalRegistrar.cs

@ -0,0 +1,43 @@
using System;
using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AspNetCore.SignalR
{
public class AbpSignalRConventionalRegistrar : ConventionalRegistrarBase
{
public override void AddType(IServiceCollection services, Type type)
{
if (IsConventionalRegistrationDisabled(type))
{
return;
}
if (!IsHub(type))
{
return;
}
var serviceTypes = ExposedServiceExplorer.GetExposedServices(type);
TriggerServiceExposing(services, type, serviceTypes);
foreach (var serviceType in serviceTypes)
{
services.Add(
ServiceDescriptor.Describe(
serviceType,
type,
ServiceLifetime.Transient
)
);
}
}
private static bool IsHub(Type type)
{
return typeof(Hub).IsAssignableFrom(type);
}
}
}

14
framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpSignalROptions.cs

@ -0,0 +1,14 @@
using System.Collections.Generic;
namespace Volo.Abp.AspNetCore.SignalR
{
public class AbpSignalROptions
{
public List<HubConfig> Hubs { get; }
public AbpSignalROptions()
{
Hubs = new List<HubConfig>();
}
}
}

21
framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpSignalRUserIdProvider.cs

@ -0,0 +1,21 @@
using Microsoft.AspNetCore.SignalR;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Users;
namespace Volo.Abp.AspNetCore.SignalR
{
public class AbpSignalRUserIdProvider : IUserIdProvider, ITransientDependency
{
public ICurrentUser CurrentUser { get; }
public AbpSignalRUserIdProvider(ICurrentUser currentUser)
{
CurrentUser = currentUser;
}
public virtual string GetUserId(HubConnectionContext connection)
{
return CurrentUser.Id?.ToString();
}
}
}

43
framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/HubConfig.cs

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using JetBrains.Annotations;
using Microsoft.AspNetCore.Http.Connections;
using Microsoft.AspNetCore.SignalR;
namespace Volo.Abp.AspNetCore.SignalR
{
public class HubConfig
{
[NotNull]
public Type HubType { get; }
[NotNull]
public string RoutePattern { get; set; }
[NotNull]
public List<Action<HttpConnectionDispatcherOptions>> ConfigureActions { get; set; }
public HubConfig(
[NotNull] Type hubType,
[NotNull] string routePattern)
{
HubType = Check.NotNull(hubType, nameof(hubType));
RoutePattern = Check.NotNullOrWhiteSpace(routePattern, nameof(routePattern));
ConfigureActions = new List<Action<HttpConnectionDispatcherOptions>>();
}
public static HubConfig Create<THub>()
where THub : Hub
{
return Create(typeof(THub));
}
public static HubConfig Create(Type hubType)
{
return new HubConfig(
hubType,
HubRouteAttribute.GetRoutePattern(hubType)
);
}
}
}

33
framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/HubRouteAttribute.cs

@ -0,0 +1,33 @@
using System;
using System.Reflection;
using Microsoft.AspNetCore.SignalR;
namespace Volo.Abp.AspNetCore.SignalR
{
public class HubRouteAttribute : Attribute
{
public string RoutePattern { get; set; }
public HubRouteAttribute(string routePattern)
{
RoutePattern = routePattern;
}
public static string GetRoutePattern<THub>()
where THub : Hub
{
return GetRoutePattern(typeof(THub));
}
public static string GetRoutePattern(Type hubType)
{
var routeAttribute = hubType.GetSingleAttributeOrNull<HubRouteAttribute>();
if (routeAttribute != null)
{
return routeAttribute.RoutePattern;
}
return "/signalr-hubs/" + hubType.Name.RemovePostFix("Hub").ToKebabCase();
}
}
}

47
framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Builder/AbpAspNetCoreApplicationBuilderExtensions.cs

@ -0,0 +1,47 @@
using System;
using System.Linq;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
namespace Microsoft.AspNetCore.Builder
{
public static class AbpAspNetCoreApplicationBuilderExtensions
{
/// <summary>
/// Maps endpoints configured with the <see cref="AbpEndpointRouterOptions"/>.
/// It internally uses the standard app.UseEndpoints(...) method.
/// </summary>
/// <param name="app">The application builder</param>
/// <param name="additionalConfigurationAction">Additional (and optional) endpoint configuration</param>
/// <returns></returns>
public static IApplicationBuilder UseConfiguredEndpoints(
this IApplicationBuilder app,
Action<IEndpointRouteBuilder> additionalConfigurationAction = null)
{
var options = app.ApplicationServices
.GetRequiredService<IOptions<AbpEndpointRouterOptions>>()
.Value;
if (!options.EndpointConfigureActions.Any())
{
return app;
}
return app.UseEndpoints(endpoints =>
{
using (var scope = app.ApplicationServices.CreateScope())
{
var context = new EndpointRouteBuilderContext(endpoints, scope.ServiceProvider);
foreach (var configureAction in options.EndpointConfigureActions)
{
configureAction(context);
}
additionalConfigurationAction?.Invoke(endpoints);
}
});
}
}
}

15
framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Routing/AbpEndpointRouterOptions.cs

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
namespace Microsoft.AspNetCore.Routing
{
public class AbpEndpointRouterOptions
{
public List<Action<EndpointRouteBuilderContext>> EndpointConfigureActions { get; }
public AbpEndpointRouterOptions()
{
EndpointConfigureActions = new List<Action<EndpointRouteBuilderContext>>();
}
}
}

18
framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Routing/EndpointRouteBuilderContext.cs

@ -0,0 +1,18 @@
using System;
namespace Microsoft.AspNetCore.Routing
{
public class EndpointRouteBuilderContext
{
public IEndpointRouteBuilder Endpoints { get; }
public IServiceProvider ScopeServiceProvider { get; }
public EndpointRouteBuilderContext(
IEndpointRouteBuilder endpoints,
IServiceProvider scopeServiceProvider)
{
Endpoints = endpoints;
ScopeServiceProvider = scopeServiceProvider;
}
}
}

13
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/VirtualFileSystem/WebContentFileProvider.cs

@ -99,17 +99,14 @@ namespace Volo.Abp.AspNetCore.VirtualFileSystem
_virtualFileProvider _virtualFileProvider
}; };
if (_hostingEnvironment.IsDevelopment() && if (_hostingEnvironment.IsDevelopment() &&
_hostingEnvironment.WebRootFileProvider is CompositeFileProvider compositeFileProvider) _hostingEnvironment.WebRootFileProvider is CompositeFileProvider compositeFileProvider)
{ {
var staticWebAssetsFileProvider = compositeFileProvider var staticWebAssetsFileProviders = compositeFileProvider
.FileProviders .FileProviders
.FirstOrDefault(f => f.GetType().Name.Equals("StaticWebAssetsFileProvider")); .Where(f => f.GetType().Name.Equals("StaticWebAssetsFileProvider")).ToList();
if (staticWebAssetsFileProvider != null) fileProviders.AddRange(staticWebAssetsFileProviders);
{
fileProviders.Add(staticWebAssetsFileProvider);
}
} }
return new CompositeFileProvider( return new CompositeFileProvider(
@ -127,4 +124,4 @@ namespace Volo.Abp.AspNetCore.VirtualFileSystem
return Options.AllowedExtraWebContentFileExtensions.Any(e => path.EndsWith(e, StringComparison.OrdinalIgnoreCase)); return Options.AllowedExtraWebContentFileExtensions.Any(e => path.EndsWith(e, StringComparison.OrdinalIgnoreCase));
} }
} }
} }

49
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs

@ -21,6 +21,7 @@ namespace Volo.Abp.Cli.Commands
public static Dictionary<string, Dictionary<string, string>> propertyList = new Dictionary<string, Dictionary<string, string>>(); public static Dictionary<string, Dictionary<string, string>> propertyList = new Dictionary<string, Dictionary<string, string>>();
public ILogger<GenerateProxyCommand> Logger { get; set; } public ILogger<GenerateProxyCommand> Logger { get; set; }
public static string outputPrefix = "src/app"; public static string outputPrefix = "src/app";
public static string output = "";
protected TemplateProjectBuilder TemplateProjectBuilder { get; } protected TemplateProjectBuilder TemplateProjectBuilder { get; }
@ -57,6 +58,12 @@ namespace Volo.Abp.Cli.Commands
var uiFramework = GetUiFramework(commandLineArgs); var uiFramework = GetUiFramework(commandLineArgs);
output = commandLineArgs.Options.GetOrNull(Options.Output.Short, Options.Output.Long);
if (!string.IsNullOrWhiteSpace(output) && !(output.EndsWith("/") || output.EndsWith("\\")))
{
output += "/";
}
WebClient client = new WebClient(); WebClient client = new WebClient();
string json = ""; string json = "";
try try
@ -99,7 +106,10 @@ namespace Volo.Abp.Cli.Commands
var rootPath = moduleItem.Key; var rootPath = moduleItem.Key;
var apiName = apiNameList.Where(p => p.Key == rootPath).Select(p => p.Value).FirstOrDefault(); var apiName = apiNameList.Where(p => p.Key == rootPath).Select(p => p.Value).FirstOrDefault();
Logger.LogInformation($"{rootPath} directory is creating"); if (rootPath != "app")
{
Logger.LogInformation($"{rootPath} directory is creating");
}
if (rootPath == "app") if (rootPath == "app")
{ {
@ -110,7 +120,7 @@ namespace Volo.Abp.Cli.Commands
outputPrefix = "src/app"; outputPrefix = "src/app";
} }
Directory.CreateDirectory($"{outputPrefix}/{rootPath}"); Directory.CreateDirectory(output + $"{outputPrefix}/{rootPath}");
foreach (var controller in moduleValue.Root.ToList().Select(item => item.First)) foreach (var controller in moduleValue.Root.ToList().Select(item => item.First))
{ {
@ -140,8 +150,8 @@ namespace Volo.Abp.Cli.Commands
var controllerPathName = controllerName.ToLower().Replace("controller", ""); var controllerPathName = controllerName.ToLower().Replace("controller", "");
controllerPathName = (controllerPathName.StartsWith(rootPath)) ? controllerPathName.Substring(rootPath.Length) : controllerPathName; controllerPathName = (controllerPathName.StartsWith(rootPath)) ? controllerPathName.Substring(rootPath.Length) : controllerPathName;
Directory.CreateDirectory($"{outputPrefix}/{rootPath}/{controllerPathName}/models"); Directory.CreateDirectory(output + $"{outputPrefix}/{rootPath}/{controllerPathName}/models");
Directory.CreateDirectory($"{outputPrefix}/{rootPath}/{controllerPathName}/services"); Directory.CreateDirectory(output + $"{outputPrefix}/{rootPath}/{controllerPathName}/services");
foreach (var actionItem in controller["actions"]) foreach (var actionItem in controller["actions"])
{ {
@ -240,7 +250,7 @@ namespace Volo.Abp.Cli.Commands
foreach (var parameterItem in parameterModel.OrderBy(p => p.DisplayOrder)) foreach (var parameterItem in parameterModel.OrderBy(p => p.DisplayOrder))
{ {
var parameterItemModelName = parameterItem.Type.PascalToKebabCase() + ".ts"; var parameterItemModelName = parameterItem.Type.PascalToKebabCase() + ".ts";
var parameterItemModelPath = $"{outputPrefix}/{rootPath}/{controllerPathName}/models/{parameterItemModelName}"; var parameterItemModelPath = output + $"{outputPrefix}/{rootPath}/{controllerPathName}/models/{parameterItemModelName}";
if (parameterItem.BindingSourceId == "body" && !File.Exists(parameterItemModelPath)) if (parameterItem.BindingSourceId == "body" && !File.Exists(parameterItemModelPath))
{ {
parameterItem.Type = "any"; parameterItem.Type = "any";
@ -277,7 +287,7 @@ namespace Volo.Abp.Cli.Commands
var secondType = secondTypeArray[secondTypeArray.Length - 1].TrimEnd('>'); var secondType = secondTypeArray[secondTypeArray.Length - 1].TrimEnd('>');
var secondTypeModelName = secondType.PascalToKebabCase() + ".ts"; var secondTypeModelName = secondType.PascalToKebabCase() + ".ts";
var secondTypeModelPath = $"{outputPrefix}/{rootPath}/{controllerPathName}/models/{secondTypeModelName}"; var secondTypeModelPath = output + $"{outputPrefix}/{rootPath}/{controllerPathName}/models/{secondTypeModelName}";
if (firstType == "List" && !File.Exists(secondTypeModelPath)) if (firstType == "List" && !File.Exists(secondTypeModelPath))
{ {
secondType = "any"; secondType = "any";
@ -374,7 +384,7 @@ namespace Volo.Abp.Cli.Commands
serviceFileText.AppendLine("}"); serviceFileText.AppendLine("}");
serviceFileText.Replace("[controllerName]", controllerName); serviceFileText.Replace("[controllerName]", controllerName);
File.WriteAllText($"{outputPrefix}/{rootPath}/{controllerPathName}/services/{controllerServiceName}", serviceFileText.ToString()); File.WriteAllText(output + $"{outputPrefix}/{rootPath}/{controllerPathName}/services/{controllerServiceName}", serviceFileText.ToString());
@ -385,7 +395,7 @@ namespace Volo.Abp.Cli.Commands
serviceIndexFileText.AppendLine($"export * from './{serviceIndexItem}';"); serviceIndexFileText.AppendLine($"export * from './{serviceIndexItem}';");
} }
File.WriteAllText($"{outputPrefix}/{rootPath}/{controllerPathName}/services/index.ts", serviceIndexFileText.ToString()); File.WriteAllText(output + $"{outputPrefix}/{rootPath}/{controllerPathName}/services/index.ts", serviceIndexFileText.ToString());
if (modelIndexList.Count > 0) if (modelIndexList.Count > 0)
{ {
@ -396,7 +406,7 @@ namespace Volo.Abp.Cli.Commands
modelIndexFileText.AppendLine($"export * from './{modelIndexItem}';"); modelIndexFileText.AppendLine($"export * from './{modelIndexItem}';");
} }
File.WriteAllText($"{outputPrefix}/{rootPath}/{controllerPathName}/models/index.ts", modelIndexFileText.ToString()); File.WriteAllText(output + $"{outputPrefix}/{rootPath}/{controllerPathName}/models/index.ts", modelIndexFileText.ToString());
} }
} }
} }
@ -467,6 +477,7 @@ namespace Volo.Abp.Cli.Commands
|| returnValueType.Contains("ActionResult") || returnValueType.Contains("ActionResult")
|| returnValueType.Contains("IStringValueType") || returnValueType.Contains("IStringValueType")
|| returnValueType.Contains("IValueValidator") || returnValueType.Contains("IValueValidator")
|| returnValueType.Contains("Guid")
) )
{ {
return null; return null;
@ -483,7 +494,7 @@ namespace Volo.Abp.Cli.Commands
var typeModelName = typeName.Replace("<", "").Replace(">", "").Replace("?", "").PascalToKebabCase() + ".ts"; var typeModelName = typeName.Replace("<", "").Replace(">", "").Replace("?", "").PascalToKebabCase() + ".ts";
var path = $"{outputPrefix}/{rootPath}/{controllerPathName}/models/{typeModelName}"; var path = output + $"{outputPrefix}/{rootPath}/{controllerPathName}/models/{typeModelName}";
var modelFileText = new StringBuilder(); var modelFileText = new StringBuilder();
@ -513,7 +524,9 @@ namespace Volo.Abp.Cli.Commands
baseTypeName = "string"; baseTypeName = "string";
} }
modelFileText.AppendLine(Environment.NewLine);
modelFileText.AppendLine($"import {{ {baseTypeName} }} from '{baseTypeKebabCase}';"); modelFileText.AppendLine($"import {{ {baseTypeName} }} from '{baseTypeKebabCase}';");
extends = "extends " + (!string.IsNullOrWhiteSpace(customBaseTypeName) ? customBaseTypeName : baseTypeName); extends = "extends " + (!string.IsNullOrWhiteSpace(customBaseTypeName) ? customBaseTypeName : baseTypeName);
var modelIndex = CreateType(data, baseType, rootPath, modelIndexList, controllerPathName); var modelIndex = CreateType(data, baseType, rootPath, modelIndexList, controllerPathName);
@ -582,7 +595,7 @@ namespace Volo.Abp.Cli.Commands
) )
{ {
var typeSimpleModelName = typeSimple.PascalToKebabCase() + ".ts"; var typeSimpleModelName = typeSimple.PascalToKebabCase() + ".ts";
var modelPath = $"{outputPrefix}/{rootPath}/{controllerPathName}/models/{typeSimpleModelName}"; var modelPath = output + $"{outputPrefix}/{rootPath}/{controllerPathName}/models/{typeSimpleModelName}";
if (!File.Exists(modelPath)) if (!File.Exists(modelPath))
{ {
typeSimple = "any" + (typeSimple.Contains("[]") ? "[]" : ""); typeSimple = "any" + (typeSimple.Contains("[]") ? "[]" : "");
@ -601,14 +614,13 @@ namespace Volo.Abp.Cli.Commands
var propertyType = propertyTypeSplit[propertyTypeSplit.Length - 1]; var propertyType = propertyTypeSplit[propertyTypeSplit.Length - 1];
var propertyTypeKebabCase = propertyType.PascalToKebabCase(); var propertyTypeKebabCase = propertyType.PascalToKebabCase();
if (File.Exists($"{outputPrefix}/{rootPath}/{controllerPathName}/models/{propertyTypeKebabCase}.ts")) if (File.Exists(output + $"{outputPrefix}/{rootPath}/{controllerPathName}/models/{propertyTypeKebabCase}.ts"))
{ {
from = "./" + propertyTypeKebabCase; from = "./" + propertyTypeKebabCase;
} }
modelFileText.Insert(0, "");
modelFileText.Insert(0, $"import {{ {propertyType} }} from '{from}';"); modelFileText.Insert(0, $"import {{ {propertyType} }} from '{from}';");
modelFileText.Insert(0, ""); modelFileText.Insert(0, Environment.NewLine);
modelIndexList.Add(modelIndex); modelIndexList.Add(modelIndex);
} }
@ -651,7 +663,7 @@ namespace Volo.Abp.Cli.Commands
modelFileText.AppendLine("}"); modelFileText.AppendLine("}");
} }
File.WriteAllText($"{outputPrefix}/{rootPath}/{controllerPathName}/models/{typeModelName}", modelFileText.ToString()); File.WriteAllText(output + $"{outputPrefix}/{rootPath}/{controllerPathName}/models/{typeModelName}", modelFileText.ToString());
return typeModelName.Replace(".ts", ""); return typeModelName.Replace(".ts", "");
} }
@ -758,6 +770,11 @@ namespace Volo.Abp.Cli.Commands
public const string Short = "u"; public const string Short = "u";
public const string Long = "ui"; public const string Long = "ui";
} }
public static class Output
{
public const string Short = "o";
public const string Long = "out";
}
} }
} }

16
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs

@ -54,14 +54,8 @@ namespace Volo.Abp.Cli.ProjectBuilding
string templateSource = null) string templateSource = null)
{ {
DirectoryHelper.CreateIfNotExists(CliPaths.TemplateCache); DirectoryHelper.CreateIfNotExists(CliPaths.TemplateCache);
var latestVersion = await GetLatestSourceCodeVersionAsync(name, type);
string latestVersion;
#if DEBUG
latestVersion = await GetLatestSourceCodeVersionAsync(name, type, $"{CliUrls.WwwAbpIoProduction}api/download/{type}/get-version/");
#else
latestVersion = await GetLatestSourceCodeVersionAsync(name, type);
#endif
if (version == null) if (version == null)
{ {
if (latestVersion == null) if (latestVersion == null)
@ -84,13 +78,7 @@ namespace Volo.Abp.Cli.ProjectBuilding
version = latestVersion; version = latestVersion;
} }
string nugetVersion; var nugetVersion = (await GetTemplateNugetVersionAsync(name, type, version)) ?? version;
#if DEBUG
nugetVersion = version;
#else
nugetVersion = (await GetTemplateNugetVersionAsync(name, type, version)) ?? version;
#endif
if (!string.IsNullOrWhiteSpace(templateSource) && !IsNetworkSource(templateSource)) if (!string.IsNullOrWhiteSpace(templateSource) && !IsNetworkSource(templateSource))
{ {

23
framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/es.json

@ -0,0 +1,23 @@
{
"culture": "es",
"texts": {
"DisplayName:Abp.Mailing.DefaultFromAddress": "Dirección de envío",
"DisplayName:Abp.Mailing.DefaultFromDisplayName": "Nombre de envío",
"DisplayName:Abp.Mailing.Smtp.Host": "Host",
"DisplayName:Abp.Mailing.Smtp.Port": "Puerto",
"DisplayName:Abp.Mailing.Smtp.UserName": "Nombre de usuario",
"DisplayName:Abp.Mailing.Smtp.Password": "Contraseña",
"DisplayName:Abp.Mailing.Smtp.Domain": "Dominio",
"DisplayName:Abp.Mailing.Smtp.EnableSsl": "Habilitar SSL",
"DisplayName:Abp.Mailing.Smtp.UseDefaultCredentials": "Usar las credenciales por defecto",
"Description:Abp.Mailing.DefaultFromAddress": "La dirección de envío por defecto",
"Description:Abp.Mailing.DefaultFromDisplayName": "El nombre de envío por defecto",
"Description:Abp.Mailing.Smtp.Host": "El nombre o dirección del host para transacciones SMTP.",
"Description:Abp.Mailing.Smtp.Port": "El puerto usado para transacciones SMTP.",
"Description:Abp.Mailing.Smtp.UserName": "Nombre de usuario asociado a las credenciales.",
"Description:Abp.Mailing.Smtp.Password": "La contraseña del ususario asociado a las credenciales.",
"Description:Abp.Mailing.Smtp.Domain": "El dominio o equipo que valida las credenciales.",
"Description:Abp.Mailing.Smtp.EnableSsl": "Si SmtpClient usa Secure Sockets Layer (SSL) para encriptar la conección.",
"Description:Abp.Mailing.Smtp.UseDefaultCredentials": "Si las credenciales por defecto se envían con los request."
}
}

16
framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/zh-Hant.json

@ -10,14 +10,16 @@
"DisplayName:Abp.Mailing.Smtp.Domain": "網域", "DisplayName:Abp.Mailing.Smtp.Domain": "網域",
"DisplayName:Abp.Mailing.Smtp.EnableSsl": "啟用SSL", "DisplayName:Abp.Mailing.Smtp.EnableSsl": "啟用SSL",
"DisplayName:Abp.Mailing.Smtp.UseDefaultCredentials": "使用預設憑證", "DisplayName:Abp.Mailing.Smtp.UseDefaultCredentials": "使用預設憑證",
"Description:Abp.Mailing.DefaultFromAddress": "預設的發信者地址.", "Description:Abp.Mailing.DefaultFromAddress": "預設發信者地址.",
"Description:Abp.Mailing.DefaultFromDisplayName": "預設的發信者名稱.", "Description:Abp.Mailing.DefaultFromDisplayName": "預設發信者名稱.",
"Description:Abp.Mailing.Smtp.Host": "SMTP 服務的主機名稱或主機IP位址.", "Description:Abp.Mailing.Smtp.Host": "SMTP 服務的主機名稱或IP位址.",
"Description:Abp.Mailing.Smtp.Port": "SMTP 服務的埠號.", "Description:Abp.Mailing.Smtp.Port": "SMTP 服務的埠號.",
"Description:Abp.Mailing.Smtp.UserName": "憑證使用者名稱.", "Description:Abp.Mailing.Smtp.UserName": "憑證使用者名稱.",
"Description:Abp.Mailing.Smtp.Password": "憑證使用者密碼.", "Description:Abp.Mailing.Smtp.Password": "憑證使用者密碼.",
"Description:Abp.Mailing.Smtp.Domain": "驗證憑證的網域名稱或電腦名稱.", "Description:Abp.Mailing.Smtp.Domain": "驗證憑證的網域或電腦名稱.",
"Description:Abp.Mailing.Smtp.EnableSsl": "設定 SmtpClient 是否使用安全通訊協定.", "Description:Abp.Mailing.Smtp.EnableSsl": "指定 SmtpClient 是否使用安全通訊(SSL)協定.",
"Description:Abp.Mailing.Smtp.UseDefaultCredentials": "設定是否使用預設憑證." "Description:Abp.Mailing.Smtp.UseDefaultCredentials": "設定是否使用預設憑證.",
"TextTemplate:StandardEmailTemplates.Layout": "預設的電子郵件樣式",
"TextTemplate:StandardEmailTemplates.Message": "電子郵件內的文字訊息"
} }
} }

8
framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/AbpDbContextConfigurationContextPostgreSqlExtensions.cs

@ -8,9 +8,17 @@ namespace Volo.Abp.EntityFrameworkCore
{ {
public static class AbpDbContextConfigurationContextPostgreSqlExtensions public static class AbpDbContextConfigurationContextPostgreSqlExtensions
{ {
[Obsolete("Use 'UseNpgsql(...)' method instead. This will be removed in future versions.")]
public static DbContextOptionsBuilder UsePostgreSql( public static DbContextOptionsBuilder UsePostgreSql(
[NotNull] this AbpDbContextConfigurationContext context, [NotNull] this AbpDbContextConfigurationContext context,
[CanBeNull] Action<NpgsqlDbContextOptionsBuilder> postgreSqlOptionsAction = null) [CanBeNull] Action<NpgsqlDbContextOptionsBuilder> postgreSqlOptionsAction = null)
{
return context.UseNpgsql(postgreSqlOptionsAction);
}
public static DbContextOptionsBuilder UseNpgsql(
[NotNull] this AbpDbContextConfigurationContext context,
[CanBeNull] Action<NpgsqlDbContextOptionsBuilder> postgreSqlOptionsAction = null)
{ {
if (context.ExistingConnection != null) if (context.ExistingConnection != null)
{ {

27
framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/AbpDbContextOptionsPostgreSqlExtensions.cs

@ -6,16 +6,18 @@ namespace Volo.Abp.EntityFrameworkCore
{ {
public static class AbpDbContextOptionsPostgreSqlExtensions public static class AbpDbContextOptionsPostgreSqlExtensions
{ {
[Obsolete("Use 'UseNpgsql(...)' method instead. This will be removed in future versions.")]
public static void UsePostgreSql( public static void UsePostgreSql(
[NotNull] this AbpDbContextOptions options, [NotNull] this AbpDbContextOptions options,
[CanBeNull] Action<NpgsqlDbContextOptionsBuilder> postgreSqlOptionsAction = null) [CanBeNull] Action<NpgsqlDbContextOptionsBuilder> postgreSqlOptionsAction = null)
{ {
options.Configure(context => options.Configure(context =>
{ {
context.UsePostgreSql(postgreSqlOptionsAction); context.UseNpgsql(postgreSqlOptionsAction);
}); });
} }
[Obsolete("Use 'UseNpgsql(...)' method instead. This will be removed in future versions.")]
public static void UsePostgreSql<TDbContext>( public static void UsePostgreSql<TDbContext>(
[NotNull] this AbpDbContextOptions options, [NotNull] this AbpDbContextOptions options,
[CanBeNull] Action<NpgsqlDbContextOptionsBuilder> postgreSqlOptionsAction = null) [CanBeNull] Action<NpgsqlDbContextOptionsBuilder> postgreSqlOptionsAction = null)
@ -23,7 +25,28 @@ namespace Volo.Abp.EntityFrameworkCore
{ {
options.Configure<TDbContext>(context => options.Configure<TDbContext>(context =>
{ {
context.UsePostgreSql(postgreSqlOptionsAction); context.UseNpgsql(postgreSqlOptionsAction);
});
}
public static void UseNpgsql(
[NotNull] this AbpDbContextOptions options,
[CanBeNull] Action<NpgsqlDbContextOptionsBuilder> postgreSqlOptionsAction = null)
{
options.Configure(context =>
{
context.UseNpgsql(postgreSqlOptionsAction);
});
}
public static void UseNpgsql<TDbContext>(
[NotNull] this AbpDbContextOptions options,
[CanBeNull] Action<NpgsqlDbContextOptionsBuilder> postgreSqlOptionsAction = null)
where TDbContext : AbpDbContext<TDbContext>
{
options.Configure<TDbContext>(context =>
{
context.UseNpgsql(postgreSqlOptionsAction);
}); });
} }
} }

1
framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj

@ -28,5 +28,4 @@
<ProjectReference Include="..\Volo.Abp.Settings\Volo.Abp.Settings.csproj" /> <ProjectReference Include="..\Volo.Abp.Settings\Volo.Abp.Settings.csproj" />
<ProjectReference Include="..\Volo.Abp.VirtualFileSystem\Volo.Abp.VirtualFileSystem.csproj" /> <ProjectReference Include="..\Volo.Abp.VirtualFileSystem\Volo.Abp.VirtualFileSystem.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

2
framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ObjectExtensionManager.cs

@ -9,7 +9,7 @@ namespace Volo.Abp.ObjectExtending
{ {
public class ObjectExtensionManager public class ObjectExtensionManager
{ {
public static ObjectExtensionManager Instance { get; set; } = new ObjectExtensionManager(); public static ObjectExtensionManager Instance { get; protected set; } = new ObjectExtensionManager();
[NotNull] [NotNull]
public ConcurrentDictionary<object, object> Configuration { get; } public ConcurrentDictionary<object, object> Configuration { get; }

13
framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/VirtualFiles/LocalizedTemplateContentReaderFactory.cs

@ -1,5 +1,4 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
@ -42,12 +41,18 @@ namespace Volo.Abp.TextTemplating.VirtualFiles
} }
finally finally
{ {
_lock.ExitWriteLock(); if (_lock.IsWriteLockHeld)
{
_lock.ExitWriteLock();
}
} }
} }
finally finally
{ {
_lock.ExitUpgradeableReadLock(); if (_lock.IsUpgradeableReadLockHeld)
{
_lock.ExitUpgradeableReadLock();
}
} }
} }

2
framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/es.json

@ -1,6 +1,6 @@
{ {
"culture": "es", "culture": "es",
"texts": { "texts": {
"Menu:Administration": "Administración" "Menu:Administration": "Administración"
} }
} }

38
framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/es.json

@ -1,20 +1,20 @@
{ {
"culture": "es", "culture": "es",
"texts": { "texts": {
"InternalServerErrorMessage": "Ocurrió un error interno en su pedido!", "InternalServerErrorMessage": "Ocurrió un error interno en su pedido!",
"ValidationErrorMessage": "Su pedido no es válido!", "ValidationErrorMessage": "Su pedido no es válido!",
"ValidationNarrativeErrorMessageTitle": "Los siguientes errores se encontraton durante la validación.", "ValidationNarrativeErrorMessageTitle": "Los siguientes errores se encontraton durante la validación.",
"DefaultErrorMessage": "Ocurrió un error!", "DefaultErrorMessage": "Ocurrió un error!",
"DefaultErrorMessageDetail": "El servidor no envió el detalle del error.", "DefaultErrorMessageDetail": "El servidor no envió el detalle del error.",
"DefaultErrorMessage401": "Usted no ha iniciado sessión!", "DefaultErrorMessage401": "Usted no ha iniciado sessión!",
"DefaultErrorMessage401Detail": "Debe iniciar sessión para ejecutar esta operación.", "DefaultErrorMessage401Detail": "Debe iniciar sessión para ejecutar esta operación.",
"DefaultErrorMessage403": "Usted no está autorizado!", "DefaultErrorMessage403": "Usted no está autorizado!",
"DefaultErrorMessage403Detail": "Usted no puede hacer esta operación!", "DefaultErrorMessage403Detail": "Usted no puede hacer esta operación!",
"DefaultErrorMessage404": "No se encontró el recurso!", "DefaultErrorMessage404": "No se encontró el recurso!",
"DefaultErrorMessage404Detail": "El recurso solicitado no se encontró en el servidor!", "DefaultErrorMessage404Detail": "El recurso solicitado no se encontró en el servidor!",
"EntityNotFoundErrorMessage": "No hay una entidad {0} con el id = {1}!", "EntityNotFoundErrorMessage": "No hay una entidad {0} con el id = {1}!",
"Error": "Error", "Error": "Error",
"AreYouSure": "¿Está seguro?", "AreYouSure": "¿Está seguro?",
"Cancel": "Cancelar", "Cancel": "Cancelar",
"Yes": "Si", "Yes": "Si",
"No": "No", "No": "No",
@ -30,14 +30,14 @@
"Welcome": "Bienvenido", "Welcome": "Bienvenido",
"Login": "Iniciar session", "Login": "Iniciar session",
"Register": "Registrarse", "Register": "Registrarse",
"Logout": "Cerrar sessión", "Logout": "Cerrar sessión",
"Submit": "Enviar", "Submit": "Enviar",
"Back": "Atrás", "Back": "Atrás",
"PagerSearch": "Buscar", "PagerSearch": "Buscar",
"PagerNext": "Siguiente", "PagerNext": "Siguiente",
"PagerPrevious": "Anterior", "PagerPrevious": "Anterior",
"PagerFirst": "Primero", "PagerFirst": "Primero",
"PagerLast": "Último", "PagerLast": "Último",
"PagerInfo": "Mostrando desde _START_ hasta _END_ total _TOTAL_", "PagerInfo": "Mostrando desde _START_ hasta _END_ total _TOTAL_",
"PagerInfo{0}{1}{2}": "Mostrando desde {0} hasta {1} total {2}", "PagerInfo{0}{1}{2}": "Mostrando desde {0} hasta {1} total {2}",
"PagerInfoEmpty": "Mostrando desde 0 hasta 0 de 0 registros", "PagerInfoEmpty": "Mostrando desde 0 hasta 0 de 0 registros",
@ -45,15 +45,15 @@
"NoDataAvailableInDatatable": "No hay datos", "NoDataAvailableInDatatable": "No hay datos",
"PagerShowMenuEntries": "Mostrar _MENU_ registros", "PagerShowMenuEntries": "Mostrar _MENU_ registros",
"DatatableActionDropdownDefaultText": "Acciones", "DatatableActionDropdownDefaultText": "Acciones",
"ChangePassword": "Cambiar contraseña", "ChangePassword": "Cambiar contraseña",
"PersonalInfo": "My perfil", "PersonalInfo": "My perfil",
"AreYouSureYouWantToCancelEditingWarningMessage": "Tiene cambios sin guardar.", "AreYouSureYouWantToCancelEditingWarningMessage": "Tiene cambios sin guardar.",
"UnhandledException": "Excepción no controlada!", "UnhandledException": "Excepción no controlada!",
"401Message": "No autorizado", "401Message": "No autorizado",
"403Message": "Prohibido", "403Message": "Prohibido",
"404Message": "La página no existe", "404Message": "La página no existe",
"500Message": "Error interno del servidor", "500Message": "Error interno del servidor",
"GoHomePage": "Ir a la página principal", "GoHomePage": "Ir a la página principal",
"GoBack": "Atras" "GoBack": "Atras"
} }
} }

3
framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWorkManager.cs

@ -1,5 +1,4 @@
using System; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
namespace Volo.Abp.Uow namespace Volo.Abp.Uow

4
framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/es.json

@ -1,4 +1,4 @@
{ {
"culture": "es", "culture": "es",
"texts": { "texts": {
"'{0}' and '{1}' do not match.": "'{0} \" y \"{1} \" no coinciden.", "'{0}' and '{1}' do not match.": "'{0} \" y \"{1} \" no coinciden.",
@ -11,7 +11,7 @@
"The {0} field is not a valid phone number.": "{0} no es un número de teléfono válido.", "The {0} field is not a valid phone number.": "{0} no es un número de teléfono válido.",
"The field {0} must be between {1} and {2}.": "El campo {0} debe ser entre {1} y {2}.", "The field {0} must be between {1} and {2}.": "El campo {0} debe ser entre {1} y {2}.",
"The field {0} must match the regular expression '{1}'.": "El campo {0} no coincide con el formato solicitado.", "The field {0} must match the regular expression '{1}'.": "El campo {0} no coincide con el formato solicitado.",
"The {0} field is required.": "La {0} campo es obligatorio.", "The {0} field is required.": "El {0} campo es obligatorio.",
"The field {0} must be a string with a maximum length of {1}.": "El campo {0} debe ser una cadena con una longitud máxima de {1}.", "The field {0} must be a string with a maximum length of {1}.": "El campo {0} debe ser una cadena con una longitud máxima de {1}.",
"The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.": "El campo {0} debe ser una cadena con una longitud mínima de {2} y una longitud máxima de {1}.", "The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.": "El campo {0} debe ser una cadena con una longitud mínima de {2} y una longitud máxima de {1}.",
"The {0} field is not a valid fully-qualified http, https, or ftp URL.": "El campo {0} no es una dirección URL válida http, https o ftp.", "The {0} field is not a valid fully-qualified http, https, or ftp URL.": "El campo {0} no es una dirección URL válida http, https o ftp.",

2
framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs

@ -95,7 +95,7 @@ namespace Volo.Abp.AspNetCore.Mvc
app.UseAuthorization(); app.UseAuthorization();
app.UseAuditing(); app.UseAuditing();
app.UseUnitOfWork(); app.UseUnitOfWork();
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
} }
} }
} }

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

@ -24,7 +24,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo
app.UseRouting(); app.UseRouting();
app.UseVirtualFiles(); app.UseVirtualFiles();
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
} }
} }
} }

2
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/AbpAspNetCoreMvcUiThemeBasicDemoModule.cs

@ -57,7 +57,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo
app.UseVirtualFiles(); app.UseVirtualFiles();
app.UseRouting(); app.UseRouting();
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
} }
} }
} }

2
framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/AbpAspNetCoreMvcVersioningTestModule.cs

@ -67,7 +67,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Versioning
{ {
var app = context.GetApplicationBuilder(); var app = context.GetApplicationBuilder();
app.UseRouting(); app.UseRouting();
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
} }
} }
} }

2
framework/test/Volo.Abp.AspNetCore.Serilog.Tests/Volo/Abp/AspNetCore/App/AbpSerilogTestModule.cs

@ -33,7 +33,7 @@ namespace Volo.Abp.AspNetCore.App
app.UseMultiTenancy(); app.UseMultiTenancy();
app.UseAuditing(); app.UseAuditing();
app.UseAbpSerilogEnrichers(); app.UseAbpSerilogEnrichers();
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
} }
} }
} }

2
framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/es.json

@ -1,4 +1,4 @@
{ {
"culture": "es", "culture": "es",
"texts": { "texts": {
"USA": "Estados unidos de América", "USA": "Estados unidos de América",

2
framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/es.json

@ -1,4 +1,4 @@
{ {
"culture": "es", "culture": "es",
"texts": { "texts": {
"ThisFieldIsRequired": "El campo no puede estar vacío", "ThisFieldIsRequired": "El campo no puede estar vacío",

2
framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/es.json

@ -1,4 +1,4 @@
{ {
"culture": "es", "culture": "es",
"texts": { "texts": {
"Hello <b>{0}</b>.": "Hola <b>{0}</b>.", "Hello <b>{0}</b>.": "Hola <b>{0}</b>.",

45
modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/es.json

@ -0,0 +1,45 @@
{
"culture": "es",
"texts": {
"UserName": "Nombre de usuario",
"EmailAddress": "Dirección de correo electrónico",
"UserNameOrEmailAddress": "Nombre de usuario o dirección de correo electrónico",
"Password": "Contraseña",
"RememberMe": "Recuérdame",
"UseAnotherServiceToLogin": "Usar otro servicio para iniciar sesión",
"UserLockedOutMessage": "La cuenta de usuario ha sido bloqueada debido a los intentos de inicio de sesión no válidos. Por favor, espere unos minutos y vuelve a intentarlo.",
"InvalidUserNameOrPassword": "El nombre de usuario o la contraseña no son válidos",
"LoginIsNotAllowed": "No está permitido el inicio de sesión! Usted tendrá que confirmar su correo electrónico o número de teléfono.",
"SelfRegistrationDisabledMessage": "El autoregistro de usuario está deshabilitado para esta aplicación. Póngase en contacto con el administrador de la aplicación para registrar un nuevo usuario.",
"LocalLoginDisabledMessage": "No está habilitado el login local para esta aplicación.",
"Login": "Iniciar sesión",
"Cancel": "Cancelar",
"Register": "Registrarse",
"AreYouANewUser": "¿Usted es un usuario nuevo?",
"AlreadyRegistered": "¿Está registrado en esta aplicación?",
"InvalidLoginRequest": "Solicitud de inicio de sesión no válido",
"ThereAreNoLoginSchemesConfiguredForThisClient": "No hay ningún esquema de inicio de sesión configurado para este cliente.",
"LogInUsingYourProviderAccount": "Inicia sesión con tu cuenta de {0} ",
"DisplayName:CurrentPassword": "Contraseña actual",
"DisplayName:NewPassword": "Nueva contraseña",
"DisplayName:NewPasswordConfirm": "Confirmar nueva contraseña",
"PasswordChangedMessage": "Su contraseña ha sido cambiada con éxito.",
"DisplayName:UserName": "Nombre de usuario",
"DisplayName:Email": "Correo electrónico",
"DisplayName:Name": "Nombre",
"DisplayName:Surname": "Apellido",
"DisplayName:Password": "Contraseña",
"DisplayName:EmailAddress": "Dirección de correo electrónico",
"DisplayName:PhoneNumber": "Número de teléfono",
"PersonalSettings": "Configuración Personal",
"PersonalSettingsSaved": "Ajustes personales guardados",
"PasswordChanged": "Cambiar la contraseña",
"NewPasswordConfirmFailed": "Por favor, confirme la nueva contraseña.",
"Manage": "Administrar",
"ManageYourProfile": "Gestionar su perfil",
"DisplayName:Abp.Account.IsSelfRegistrationEnabled": "Habilitar el registro de usuario",
"Description:Abp.Account.IsSelfRegistrationEnabled": "Si está habilitado los usuarios pueden crear una cuenta mediante el registro automático.",
"DisplayName:Abp.Account.EnableLocalLogin": "Habilitar cuenta local",
"Description:Abp.Account.EnableLocalLogin": "Indica que el servidor permite iniciar sessión con una cuenta local."
}
}

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

@ -158,7 +158,7 @@ namespace Volo.BloggingTestApp
app.UseRequestLocalization(app.ApplicationServices.GetRequiredService<IOptions<RequestLocalizationOptions>>().Value); app.UseRequestLocalization(app.ApplicationServices.GetRequiredService<IOptions<RequestLocalizationOptions>>().Value);
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
using (var scope = context.ServiceProvider.CreateScope()) using (var scope = context.ServiceProvider.CreateScope())

12
modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Index.cshtml

@ -59,8 +59,8 @@
<div class="col pl-1"> <div class="col pl-1">
<h5 class="mt-2 mb-1">@post.Writer.UserName <span>@ConvertDatetimeToTimeAgo(post.CreationTime)</span></h5> <h5 class="mt-2 mb-1">@post.Writer.UserName <span>@ConvertDatetimeToTimeAgo(post.CreationTime)</span></h5>
<i class="fa fa-eye"></i> @L["WiewsWithCount", post.ReadCount] <i class="fa fa-eye"></i> @L["WiewsWithCount", post.ReadCount]
<span class="vs-seperator">|</span> @*<span class="vs-seperator">|</span>
<i class="fa fa-comment"></i> @L["CommentWithCount", post.CommentCount] <i class="fa fa-comment"></i> @L["CommentWithCount", post.CommentCount]*@
</div> </div>
</div> </div>
</div> </div>
@ -116,8 +116,8 @@
<h5 class="mt-2 mb-1">@post.Writer.UserName <span>@ConvertDatetimeToTimeAgo(post.CreationTime)</span></h5> <h5 class="mt-2 mb-1">@post.Writer.UserName <span>@ConvertDatetimeToTimeAgo(post.CreationTime)</span></h5>
} }
<i class="fa fa-eye"></i> @L["WiewsWithCount", post.ReadCount] <i class="fa fa-eye"></i> @L["WiewsWithCount", post.ReadCount]
<span class="vs-seperator">|</span> @*<span class="vs-seperator">|</span>
<i class="fa fa-comment"></i> @L["CommentWithCount", post.CommentCount] <i class="fa fa-comment"></i> @L["CommentWithCount", post.CommentCount]*@
</div> </div>
</div> </div>
</div> </div>
@ -177,8 +177,8 @@
<div class="col pl-1"> <div class="col pl-1">
<h5 class="mt-2 mb-1">@post.Writer.UserName <span>@ConvertDatetimeToTimeAgo(post.CreationTime)</span></h5> <h5 class="mt-2 mb-1">@post.Writer.UserName <span>@ConvertDatetimeToTimeAgo(post.CreationTime)</span></h5>
<i class="fa fa-eye"></i> @L["WiewsWithCount", post.ReadCount] <i class="fa fa-eye"></i> @L["WiewsWithCount", post.ReadCount]
<span class="vs-seperator">|</span> @*<span class="vs-seperator">|</span>
<i class="fa fa-comment"></i> @L["CommentWithCount", post.CommentCount] <i class="fa fa-comment"></i> @L["CommentWithCount", post.CommentCount]*@
</div> </div>
</div> </div>
</div> </div>

2
modules/client-simulation/demo/Volo.ClientSimulation.Demo/ClientSimulationDemoModule.cs

@ -42,7 +42,7 @@ namespace Volo.ClientSimulation.Demo
app.UseVirtualFiles(); app.UseVirtualFiles();
app.UseRouting(); app.UseRouting();
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
} }
} }
} }

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

@ -167,7 +167,7 @@ namespace VoloDocs.Web
//app.UseMiddleware<GlobalExceptionHandlerMiddleware>(); //app.UseMiddleware<GlobalExceptionHandlerMiddleware>();
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
using (var scope = context.ServiceProvider.CreateScope()) using (var scope = context.ServiceProvider.CreateScope())
{ {

4
modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo.Abp.IdentityServer.Domain.csproj

@ -25,8 +25,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="IdentityServer4" Version="3.0.2" /> <PackageReference Include="IdentityServer4" Version="3.1.3" />
<PackageReference Include="IdentityServer4.AspNetIdentity" Version="3.0.2" /> <PackageReference Include="IdentityServer4.AspNetIdentity" Version="3.1.3" />
</ItemGroup> </ItemGroup>
</Project> </Project>

1
npm/ng-packs/packages/core/src/lib/models/application-configuration.ts

@ -66,5 +66,6 @@ export namespace ApplicationConfiguration {
id: string; id: string;
tenantId: string; tenantId: string;
userName: string; userName: string;
email: string;
} }
} }

2
npm/ng-packs/packages/core/src/lib/states/config.state.ts

@ -324,7 +324,7 @@ function patchRouteDeep(
): ABP.FullRoute[] { ): ABP.FullRoute[] {
routes = routes.map(route => { routes = routes.map(route => {
if (route.name === name) { if (route.name === name) {
newValue.url = `${parentUrl}/${(!newValue.path && newValue.path === '' newValue.url = `${parentUrl}/${(!newValue.path || newValue.path === ''
? route.path ? route.path
: newValue.path) || ''}`; : newValue.path) || ''}`;

1
npm/ng-packs/packages/core/src/lib/tests/config-state.service.spec.ts

@ -122,6 +122,7 @@ const CONFIG_STATE_DATA = {
id: null, id: null,
tenantId: null, tenantId: null,
userName: null, userName: null,
email: null,
}, },
features: { features: {
values: {}, values: {},

1
npm/ng-packs/packages/core/src/lib/tests/config.state.spec.ts

@ -146,6 +146,7 @@ export const CONFIG_STATE_DATA = {
id: null, id: null,
tenantId: null, tenantId: null,
userName: null, userName: null,
email: null,
}, },
features: { features: {
values: {}, values: {},

10
npm/ng-packs/scripts/publish.ts

@ -28,7 +28,15 @@ const publish = async () => {
await execa( await execa(
'yarn', 'yarn',
['lerna', 'version', program.nextVersion, '--yes', '--no-commit-hooks', '--skip-git'], [
'lerna',
'version',
program.nextVersion,
'--yes',
'--no-commit-hooks',
'--skip-git',
'--force-publish',
],
{ stdout: 'inherit', cwd: '../' }, { stdout: 'inherit', cwd: '../' },
); );

1
npm/packs/prismjs/package.json

@ -6,6 +6,7 @@
}, },
"dependencies": { "dependencies": {
"@abp/core": "^2.7.0", "@abp/core": "^2.7.0",
"@abp/clipboard": "^2.7.0",
"prismjs": "^1.17.1" "prismjs": "^1.17.1"
}, },
"gitHead": "0ea3895f3b0b489e3ea81fc88f8f0896b22b61bd" "gitHead": "0ea3895f3b0b489e3ea81fc88f8f0896b22b61bd"

5
npm/packs/signalr/abp.resourcemapping.js

@ -0,0 +1,5 @@
module.exports = {
mappings: {
"@node_modules/@microsoft/signalr/dist/browser/*.*": "@libs/signalr/browser/"
}
}

12
npm/packs/signalr/package.json

@ -0,0 +1,12 @@
{
"version": "2.7.0",
"name": "@abp/signalr",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@abp/core": "^2.7.0",
"@microsoft/signalr": "^3.1.3"
},
"gitHead": "0ea3895f3b0b489e3ea81fc88f8f0896b22b61bd"
}

1
nupkg/common.ps1

@ -41,6 +41,7 @@ $projects = (
"framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared", "framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared",
"framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets", "framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets",
"framework/src/Volo.Abp.AspNetCore.Serilog", "framework/src/Volo.Abp.AspNetCore.Serilog",
"framework/src/Volo.Abp.AspNetCore.SignalR",
"framework/src/Volo.Abp.AspNetCore.TestBase", "framework/src/Volo.Abp.AspNetCore.TestBase",
"framework/src/Volo.Abp.Auditing", "framework/src/Volo.Abp.Auditing",
"framework/src/Volo.Abp.Authorization", "framework/src/Volo.Abp.Authorization",

2
samples/MicroserviceDemo/applications/AuthServer.Host/AuthServerHostModule.cs

@ -102,7 +102,7 @@ namespace AuthServer.Host
app.UseIdentityServer(); app.UseIdentityServer();
app.UseAbpRequestLocalization(); app.UseAbpRequestLocalization();
app.UseAuditing(); app.UseAuditing();
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
//TODO: Problem on a clustered environment //TODO: Problem on a clustered environment
AsyncHelper.RunSync(async () => AsyncHelper.RunSync(async () =>

2
samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminAppHostModule.cs

@ -130,7 +130,7 @@ namespace BackendAdminApp.Host
{ {
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Backend Admin Application API"); options.SwaggerEndpoint("/swagger/v1/swagger.json", "Backend Admin Application API");
}); });
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
} }
} }
} }

2
samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSiteHostModule.cs

@ -103,7 +103,7 @@ namespace PublicWebSite.Host
} }
app.UseAuthorization(); app.UseAuthorization();
app.UseAbpRequestLocalization(); app.UseAbpRequestLocalization();
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
} }
} }
} }

2
samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGatewayHostModule.cs

@ -141,7 +141,7 @@ namespace BackendAdminAppGateway.Host
app2 => app2 =>
{ {
app2.UseRouting(); app2.UseRouting();
app2.UseMvcWithDefaultRouteAndArea(); app2.UseConfiguredEndpoints();
} }
); );

2
samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGatewayHostModule.cs

@ -122,7 +122,7 @@ namespace InternalGateway.Host
app2 => app2 =>
{ {
app2.UseRouting(); app2.UseRouting();
app2.UseMvcWithDefaultRouteAndArea(); app2.UseConfiguredEndpoints();
} }
); );

2
samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGatewayHostModule.cs

@ -116,7 +116,7 @@ namespace PublicWebSiteGateway.Host
app2 => app2 =>
{ {
app2.UseRouting(); app2.UseRouting();
app2.UseMvcWithDefaultRouteAndArea(); app2.UseConfiguredEndpoints();
} }
); );

4
samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingServiceHostModule.cs

@ -13,6 +13,7 @@ using MsDemo.Shared;
using Swashbuckle.AspNetCore.Swagger; using Swashbuckle.AspNetCore.Swagger;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.AspNetCore.MultiTenancy; using Volo.Abp.AspNetCore.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Auditing; using Volo.Abp.Auditing;
using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.Autofac; using Volo.Abp.Autofac;
@ -40,6 +41,7 @@ namespace BloggingService.Host
{ {
[DependsOn( [DependsOn(
typeof(AbpAutofacModule), typeof(AbpAutofacModule),
typeof(AbpAspNetCoreMvcModule),
typeof(AbpEventBusRabbitMqModule), typeof(AbpEventBusRabbitMqModule),
typeof(AbpEntityFrameworkCoreSqlServerModule), typeof(AbpEntityFrameworkCoreSqlServerModule),
typeof(AbpAuditLoggingEntityFrameworkCoreModule), typeof(AbpAuditLoggingEntityFrameworkCoreModule),
@ -145,7 +147,7 @@ namespace BloggingService.Host
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Blogging Service API"); options.SwaggerEndpoint("/swagger/v1/swagger.json", "Blogging Service API");
}); });
app.UseAuditing(); app.UseAuditing();
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
//TODO: Problem on a clustered environment //TODO: Problem on a clustered environment
AsyncHelper.RunSync(async () => AsyncHelper.RunSync(async () =>

4
samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityServiceHostModule.cs

@ -9,6 +9,7 @@ using Microsoft.OpenApi.Models;
using MsDemo.Shared; using MsDemo.Shared;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.AspNetCore.MultiTenancy; using Volo.Abp.AspNetCore.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Auditing; using Volo.Abp.Auditing;
using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.Autofac; using Volo.Abp.Autofac;
@ -29,6 +30,7 @@ namespace IdentityService.Host
{ {
[DependsOn( [DependsOn(
typeof(AbpAutofacModule), typeof(AbpAutofacModule),
typeof(AbpAspNetCoreMvcModule),
typeof(AbpEventBusRabbitMqModule), typeof(AbpEventBusRabbitMqModule),
typeof(AbpEntityFrameworkCoreSqlServerModule), typeof(AbpEntityFrameworkCoreSqlServerModule),
typeof(AbpAuditLoggingEntityFrameworkCoreModule), typeof(AbpAuditLoggingEntityFrameworkCoreModule),
@ -126,7 +128,7 @@ namespace IdentityService.Host
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Identity Service API"); options.SwaggerEndpoint("/swagger/v1/swagger.json", "Identity Service API");
}); });
app.UseAuditing(); app.UseAuditing();
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
} }
} }
} }

4
samples/MicroserviceDemo/microservices/ProductService.Host/ProductServiceHostModule.cs

@ -12,6 +12,7 @@ using MsDemo.Shared;
using Swashbuckle.AspNetCore.Swagger; using Swashbuckle.AspNetCore.Swagger;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.AspNetCore.MultiTenancy; using Volo.Abp.AspNetCore.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Auditing; using Volo.Abp.Auditing;
using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.Autofac; using Volo.Abp.Autofac;
@ -32,6 +33,7 @@ namespace ProductService.Host
{ {
[DependsOn( [DependsOn(
typeof(AbpAutofacModule), typeof(AbpAutofacModule),
typeof(AbpAspNetCoreMvcModule),
typeof(AbpEventBusRabbitMqModule), typeof(AbpEventBusRabbitMqModule),
typeof(AbpEntityFrameworkCoreSqlServerModule), typeof(AbpEntityFrameworkCoreSqlServerModule),
typeof(AbpAuditLoggingEntityFrameworkCoreModule), typeof(AbpAuditLoggingEntityFrameworkCoreModule),
@ -129,7 +131,7 @@ namespace ProductService.Host
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Product Service API"); options.SwaggerEndpoint("/swagger/v1/swagger.json", "Product Service API");
}); });
app.UseAuditing(); app.UseAuditing();
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
//TODO: Problem on a clustered environment //TODO: Problem on a clustered environment
AsyncHelper.RunSync(async () => AsyncHelper.RunSync(async () =>

4
samples/MicroserviceDemo/microservices/TenantManagementService.Host/TenantManagementServiceHostModule.cs

@ -9,6 +9,7 @@ using MsDemo.Shared;
using StackExchange.Redis; using StackExchange.Redis;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.AspNetCore.MultiTenancy; using Volo.Abp.AspNetCore.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Auditing; using Volo.Abp.Auditing;
using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.Autofac; using Volo.Abp.Autofac;
@ -29,6 +30,7 @@ namespace TenantManagementService.Host
{ {
[DependsOn( [DependsOn(
typeof(AbpAutofacModule), typeof(AbpAutofacModule),
typeof(AbpAspNetCoreMvcModule),
typeof(AbpEventBusRabbitMqModule), typeof(AbpEventBusRabbitMqModule),
typeof(AbpEntityFrameworkCoreSqlServerModule), typeof(AbpEntityFrameworkCoreSqlServerModule),
typeof(AbpAuditLoggingEntityFrameworkCoreModule), typeof(AbpAuditLoggingEntityFrameworkCoreModule),
@ -130,7 +132,7 @@ namespace TenantManagementService.Host
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Tenant Management Service API"); options.SwaggerEndpoint("/swagger/v1/swagger.json", "Tenant Management Service API");
}); });
app.UseAuditing(); app.UseAuditing();
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
} }
} }
} }

13
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs

@ -15,6 +15,7 @@ using Microsoft.OpenApi.Models;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.AspNetCore.Serilog; using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.Autofac; using Volo.Abp.Autofac;
using Volo.Abp.Caching; using Volo.Abp.Caching;
@ -162,6 +163,16 @@ namespace MyCompanyName.MyProjectName
public override void OnApplicationInitialization(ApplicationInitializationContext context) public override void OnApplicationInitialization(ApplicationInitializationContext context)
{ {
var app = context.GetApplicationBuilder(); var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseErrorPage();
}
app.UseCorrelationId(); app.UseCorrelationId();
app.UseVirtualFiles(); app.UseVirtualFiles();
@ -183,7 +194,7 @@ namespace MyCompanyName.MyProjectName
app.UseAuditing(); app.UseAuditing();
app.UseAbpSerilogEnrichers(); app.UseAbpSerilogEnrichers();
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
} }
} }
} }

2
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs

@ -188,7 +188,7 @@ namespace MyCompanyName.MyProjectName
app.UseAuditing(); app.UseAuditing();
app.UseAbpSerilogEnrichers(); app.UseAbpSerilogEnrichers();
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
} }
} }
} }

2
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs

@ -164,7 +164,7 @@ namespace MyCompanyName.MyProjectName
app.UseAbpRequestLocalization(); app.UseAbpRequestLocalization();
app.UseAuditing(); app.UseAuditing();
app.UseAbpSerilogEnrichers(); app.UseAbpSerilogEnrichers();
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
} }
} }
} }

5
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs

@ -213,8 +213,6 @@ namespace MyCompanyName.MyProjectName.Web
var app = context.GetApplicationBuilder(); var app = context.GetApplicationBuilder();
var env = context.GetEnvironment(); var env = context.GetEnvironment();
app.UseCorrelationId();
if (env.IsDevelopment()) if (env.IsDevelopment())
{ {
app.UseDeveloperExceptionPage(); app.UseDeveloperExceptionPage();
@ -224,6 +222,7 @@ namespace MyCompanyName.MyProjectName.Web
app.UseErrorPage(); app.UseErrorPage();
} }
app.UseCorrelationId();
app.UseVirtualFiles(); app.UseVirtualFiles();
app.UseRouting(); app.UseRouting();
app.UseAuthentication(); app.UseAuthentication();
@ -246,7 +245,7 @@ namespace MyCompanyName.MyProjectName.Web
app.UseAuditing(); app.UseAuditing();
app.UseAbpSerilogEnrichers(); app.UseAbpSerilogEnrichers();
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
} }
} }
} }

6
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs

@ -192,8 +192,6 @@ namespace MyCompanyName.MyProjectName.Web
var app = context.GetApplicationBuilder(); var app = context.GetApplicationBuilder();
var env = context.GetEnvironment(); var env = context.GetEnvironment();
app.UseCorrelationId();
if (env.IsDevelopment()) if (env.IsDevelopment())
{ {
app.UseDeveloperExceptionPage(); app.UseDeveloperExceptionPage();
@ -202,6 +200,8 @@ namespace MyCompanyName.MyProjectName.Web
{ {
app.UseErrorPage(); app.UseErrorPage();
} }
app.UseCorrelationId();
app.UseVirtualFiles(); app.UseVirtualFiles();
app.UseRouting(); app.UseRouting();
app.UseAuthentication(); app.UseAuthentication();
@ -221,7 +221,7 @@ namespace MyCompanyName.MyProjectName.Web
}); });
app.UseAuditing(); app.UseAuditing();
app.UseAbpSerilogEnrichers(); app.UseAbpSerilogEnrichers();
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
} }
} }
} }

2
templates/app/aspnet-core/test/MyCompanyName.MyProjectName.Web.Tests/MyProjectNameWebTestModule.cs

@ -107,7 +107,7 @@ namespace MyCompanyName.MyProjectName
} }
}); });
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
} }
} }
} }

12
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs

@ -15,6 +15,7 @@ using Swashbuckle.AspNetCore.Swagger;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.AspNetCore.MultiTenancy; using Volo.Abp.AspNetCore.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.AspNetCore.Serilog; using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.Autofac; using Volo.Abp.Autofac;
@ -147,11 +148,18 @@ namespace MyCompanyName.MyProjectName
public override void OnApplicationInitialization(ApplicationInitializationContext context) public override void OnApplicationInitialization(ApplicationInitializationContext context)
{ {
var app = context.GetApplicationBuilder(); var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
if (!context.GetEnvironment().IsDevelopment()) if (env.IsDevelopment())
{ {
app.UseDeveloperExceptionPage();
}
else
{
app.UseErrorPage();
app.UseHsts(); app.UseHsts();
} }
app.UseHttpsRedirection(); app.UseHttpsRedirection();
app.UseCorrelationId(); app.UseCorrelationId();
app.UseVirtualFiles(); app.UseVirtualFiles();
@ -171,7 +179,7 @@ namespace MyCompanyName.MyProjectName
}); });
app.UseAuditing(); app.UseAuditing();
app.UseAbpSerilogEnrichers(); app.UseAbpSerilogEnrichers();
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
} }
} }
} }

12
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs

@ -17,6 +17,7 @@ using Volo.Abp.AspNetCore.Authentication.JwtBearer;
using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.AspNetCore.Serilog; using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.Auditing; using Volo.Abp.Auditing;
using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.AuditLogging.EntityFrameworkCore;
@ -168,11 +169,18 @@ namespace MyCompanyName.MyProjectName
public override void OnApplicationInitialization(ApplicationInitializationContext context) public override void OnApplicationInitialization(ApplicationInitializationContext context)
{ {
var app = context.GetApplicationBuilder(); var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
if (!context.GetEnvironment().IsDevelopment()) if (env.IsDevelopment())
{ {
app.UseDeveloperExceptionPage();
}
else
{
app.UseErrorPage();
app.UseHsts(); app.UseHsts();
} }
app.UseHttpsRedirection(); app.UseHttpsRedirection();
app.UseCorrelationId(); app.UseCorrelationId();
app.UseVirtualFiles(); app.UseVirtualFiles();
@ -194,7 +202,7 @@ namespace MyCompanyName.MyProjectName
}); });
app.UseAuditing(); app.UseAuditing();
app.UseAbpSerilogEnrichers(); app.UseAbpSerilogEnrichers();
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
SeedData(context); SeedData(context);
} }

2
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs

@ -253,7 +253,7 @@ namespace MyCompanyName.MyProjectName
app.UseAuditing(); app.UseAuditing();
app.UseAbpSerilogEnrichers(); app.UseAbpSerilogEnrichers();
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
} }
} }
} }

5
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs

@ -112,8 +112,9 @@ namespace MyCompanyName.MyProjectName
public override void OnApplicationInitialization(ApplicationInitializationContext context) public override void OnApplicationInitialization(ApplicationInitializationContext context)
{ {
var app = context.GetApplicationBuilder(); var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
if (context.GetEnvironment().IsDevelopment()) if (env.IsDevelopment())
{ {
app.UseDeveloperExceptionPage(); app.UseDeveloperExceptionPage();
} }
@ -142,7 +143,7 @@ namespace MyCompanyName.MyProjectName
app.UseAbpRequestLocalization(); app.UseAbpRequestLocalization();
app.UseAuditing(); app.UseAuditing();
app.UseAbpSerilogEnrichers(); app.UseAbpSerilogEnrichers();
app.UseMvcWithDefaultRouteAndArea(); app.UseConfiguredEndpoints();
using (var scope = context.ServiceProvider.CreateScope()) using (var scope = context.ServiceProvider.CreateScope())
{ {

Loading…
Cancel
Save