diff --git a/.gitignore b/.gitignore index eb4dbedfae..9a855fd898 100644 --- a/.gitignore +++ b/.gitignore @@ -293,3 +293,10 @@ samples/MicroserviceDemo/applications/ConsoleClientDemo/Logs/logs.txt modules/docs/app/Volo.DocsTestApp/Logs/logs.txt framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/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 diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json index d0d829bbf3..14a4eb345c 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json @@ -3,6 +3,12 @@ "texts": { "Permission:Organizations": "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:NugetPackages": "Nuget Packages", "Permission:Maintenance": "Maintenance", @@ -19,6 +25,7 @@ "Menu:Organizations": "Organizations", "Menu:Accounting": "Accounting", "Menu:Packages": "Packages", + "Menu:DiscountRequests": "Discount Requests", "NpmPackageDeletionWarningMessage": "This NPM 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?", @@ -119,6 +126,27 @@ "TotalPrice": "Total Price", "Generate": "Generate", "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" } } \ No newline at end of file diff --git a/docs/cs/Entity-Framework-Core-PostgreSQL.md b/docs/cs/Entity-Framework-Core-PostgreSQL.md index 3a39c7485d..e09880c37c 100644 --- a/docs/cs/Entity-Framework-Core-PostgreSQL.md +++ b/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;`). -## 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()`. diff --git a/docs/cs/Getting-Started-AspNetCore-Application.md b/docs/cs/Getting-Started-AspNetCore-Application.md index 2e8ea1a343..877976d037 100644 --- a/docs/cs/Getting-Started-AspNetCore-Application.md +++ b/docs/cs/Getting-Started-AspNetCore-Application.md @@ -57,7 +57,7 @@ namespace BasicAspNetCoreApplication app.UseStaticFiles(); app.UseRouting(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/docs/en/Customizing-Application-Modules-Overriding-Services.md b/docs/en/Customizing-Application-Modules-Overriding-Services.md index 7f0c0502ea..b9890b3aca 100644 --- a/docs/en/Customizing-Application-Modules-Overriding-Services.md +++ b/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))] public class MyIdentityUserManager : IdentityUserManager { - public MyIdentityUserManager( - IdentityUserStore store, - IOptions optionsAccessor, - IPasswordHasher passwordHasher, - IEnumerable> userValidators, - IEnumerable> passwordValidators, - ILookupNormalizer keyNormalizer, - IdentityErrorDescriber errors, - IServiceProvider services, - ILogger logger, - ICancellationTokenProvider cancellationTokenProvider - ) : base( - store, - optionsAccessor, - passwordHasher, - userValidators, - passwordValidators, - keyNormalizer, - errors, - services, - logger, - cancellationTokenProvider) - { - } + public MyIdentityUserManager( + IdentityUserStore store, + IIdentityRoleRepository roleRepository, + IIdentityUserRepository userRepository, + IOptions optionsAccessor, + IPasswordHasher passwordHasher, + IEnumerable> userValidators, + IEnumerable> passwordValidators, + ILookupNormalizer keyNormalizer, + IdentityErrorDescriber errors, + IServiceProvider services, + ILogger logger, + ICancellationTokenProvider cancellationTokenProvider) : + base(store, + roleRepository, + userRepository, + optionsAccessor, + passwordHasher, + userValidators, + passwordValidators, + keyNormalizer, + errors, + services, + logger, + cancellationTokenProvider) + { + } public override async Task CreateAsync(IdentityUser user) { diff --git a/docs/en/Distributed-Event-Bus-RabbitMQ-Integration.md b/docs/en/Distributed-Event-Bus-RabbitMQ-Integration.md new file mode 100644 index 0000000000..dc3d5c172f --- /dev/null +++ b/docs/en/Distributed-Event-Bus-RabbitMQ-Integration.md @@ -0,0 +1,3 @@ +# Distributed Event Bus RabbitMQ Integration + +TODO \ No newline at end of file diff --git a/docs/en/Entity-Framework-Core-PostgreSQL.md b/docs/en/Entity-Framework-Core-PostgreSQL.md index 328ca4d416..4c6099b809 100644 --- a/docs/en/Entity-Framework-Core-PostgreSQL.md +++ b/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;`). -## 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()`. diff --git a/docs/en/Getting-Started-AspNetCore-Application.md b/docs/en/Getting-Started-AspNetCore-Application.md index b78ce1b9cf..9698b1dfb0 100644 --- a/docs/en/Getting-Started-AspNetCore-Application.md +++ b/docs/en/Getting-Started-AspNetCore-Application.md @@ -57,7 +57,7 @@ namespace BasicAspNetCoreApplication app.UseStaticFiles(); app.UseRouting(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md b/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md index 10b1e05a4a..434d5f8bac 100644 --- a/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md +++ b/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! * 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 domain like `https://localhost:44320/signin-azuread-oidc`, not only `/signin-azuread-oidc`. + your **Redirect URI** of your application in azure portal must be with domain 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 - - ````csharp - options.Scope.Add("email"); - ```` - - to your openid configuration. + * 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 + options.ClientSecret = "Value of your secret on azure portal"; + ```` * 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 options.Events.OnTokenValidated = (async context => - { - var claimsFromOidcProvider = context.Principal.Claims.ToList(); - await Task.CompletedTask; - }); + { + var claimsFromOidcProvider = context.Principal.Claims.ToList(); + await Task.CompletedTask; + }); ```` - ## See Also * [How to Customize the Login Page for MVC / Razor Page Applications](Customize-Login-Page-MVC.md). diff --git a/docs/en/Samples/Index.md b/docs/en/Samples/Index.md new file mode 100644 index 0000000000..0c9ce68886 --- /dev/null +++ b/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) \ No newline at end of file diff --git a/docs/en/Samples/Microservice-Demo.md b/docs/en/Samples/Microservice-Demo.md index 567d043ef9..25eaf68055 100644 --- a/docs/en/Samples/Microservice-Demo.md +++ b/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/"), app2 => { - app2.UseMvcWithDefaultRouteAndArea(); + app2.UseConfiguredEndpoints(); }); app.UseOcelot().Wait(); diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index c0515c18de..430fdf6b47 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -505,6 +505,10 @@ { "text": "Samples", "items": [ + { + "text": "All Samples", + "path": "Samples/Index.md" + }, { "text": "Microservice Demo", "path": "Samples/Microservice-Demo.md" diff --git a/docs/zh-Hans/Entity-Framework-Core-PostgreSQL.md b/docs/zh-Hans/Entity-Framework-Core-PostgreSQL.md index 08f8f405d1..350cff65b0 100644 --- a/docs/zh-Hans/Entity-Framework-Core-PostgreSQL.md +++ b/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;`). -## UsePostgreSql() +## UseNpgsql() -查找你的解决方案中 `UseSqlServer()`调用,替换为 `UsePostgreSql()`. 检查下列文件: +查找你的解决方案中 `UseSqlServer()`调用,替换为 `UseNpgsql()`. 检查下列文件: * `.EntityFrameworkCore` 项目中的*YourProjectName*EntityFrameworkCoreModule.cs. * `.EntityFrameworkCore` 项目中的*YourProjectName*MigrationsDbContextFactory.cs. diff --git a/docs/zh-Hans/Modules/Index.md b/docs/zh-Hans/Modules/Index.md index fb07b5b001..fa7b063004 100644 --- a/docs/zh-Hans/Modules/Index.md +++ b/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). diff --git a/docs/zh-Hans/Samples/Microservice-Demo.md b/docs/zh-Hans/Samples/Microservice-Demo.md index 40cb42cda6..b0134eddde 100644 --- a/docs/zh-Hans/Samples/Microservice-Demo.md +++ b/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/"), app2 => { - app2.UseMvcWithDefaultRouteAndArea(); + app2.UseConfiguredEndpoints(); }); app.UseOcelot().Wait(); diff --git a/framework/Volo.Abp.sln b/framework/Volo.Abp.sln index 5d6f3e99a2..3ff151439f 100644 --- a/framework/Volo.Abp.sln +++ b/framework/Volo.Abp.sln @@ -283,7 +283,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.TextTemplating", " 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}" 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 Global 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}.Release|Any CPU.ActiveCfg = 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 GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -991,6 +997,7 @@ Global {9E53F91F-EACD-4191-A487-E727741F1311} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} {251C7FD3-D313-4BCE-8068-352EC7EEA275} = {447C8A77-E5F0-4538-8687-7383196D04EA} {FA5D1D6A-2A05-4A3D-99C1-2B6C1D1F99A3} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {B64FCE08-E9D2-4984-BF12-FE199F257416} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {BB97ECF4-9A84-433F-A80B-2A3285BDD1D5} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/CurrentUserDto.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/CurrentUserDto.cs index 702af56dba..2197d7b08e 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/CurrentUserDto.cs +++ b/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 string UserName { get; set; } + + public string Email { get; set; } } -} \ No newline at end of file +} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/SignalR/SignalRBrowserScriptContributor.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/SignalR/SignalRBrowserScriptContributor.cs new file mode 100644 index 0000000000..736ffdb986 --- /dev/null +++ b/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"); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js index 3998f2df7f..21a8e0ce21 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js +++ b/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: Refactor & test more */ @@ -49,6 +49,7 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f var _publicApi = null; var _args = null; + var _onOpenCallbacks = new CallbackList(); var _onCloseCallbacks = 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(); + _onOpenCallbacks.triggerAll(_publicApi); }); 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'); }; + var _onOpen = function (onOpenCallback) { + _onOpenCallbacks.add(onOpenCallback); + }; + var _onClose = function (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); }, + onOpen: _onOpen, + onClose: _onClose, onResult: _onResult @@ -198,4 +206,4 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f }; })(); -})(jQuery); \ No newline at end of file +})(jQuery); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Microsoft/AspNetCore/Builder/AbpAspNetCoreMvcApplicationBuilderExtensions.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Microsoft/AspNetCore/Builder/AbpAspNetCoreMvcApplicationBuilderExtensions.cs index 9a19337c5f..daa5183709 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Microsoft/AspNetCore/Builder/AbpAspNetCoreMvcApplicationBuilderExtensions.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Microsoft/AspNetCore/Builder/AbpAspNetCoreMvcApplicationBuilderExtensions.cs @@ -15,18 +15,12 @@ namespace Microsoft.AspNetCore.Builder /// The . /// Additional action to configure routes /// A reference to this instance after the operation has completed. + [Obsolete("Use app.UseConfiguredEndpoints(...) extension method instead!")] public static IApplicationBuilder UseMvcWithDefaultRouteAndArea( this IApplicationBuilder app, Action additionalConfigurationAction = null) { - return app.UseEndpoints(endpoints => - { - endpoints.MapControllerRoute("defaultWithArea", "{area}/{controller=Home}/{action=Index}/{id?}"); - endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}"); - endpoints.MapRazorPages(); - - additionalConfigurationAction?.Invoke(endpoints); - }); + return app.UseConfiguredEndpoints(additionalConfigurationAction); } } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs index 00ba8423b3..ee81e0a22e 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs +++ b/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.Net; using System.Reflection; +using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Mvc.ApiExplorer; using Microsoft.AspNetCore.Mvc.Razor; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure; +using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Localization; using Volo.Abp.ApiVersioning; @@ -165,6 +167,16 @@ namespace Volo.Abp.AspNetCore.Mvc { mvcOptions.AddAbp(context.Services); }); + + Configure(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) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpController.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpController.cs index c3e5c61f36..2a3a25373e 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpController.cs +++ b/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); private ILoggerFactory _loggerFactory; + protected ILogger Logger => _lazyLogger.Value; + private Lazy _lazyLogger => new Lazy(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true); + public ICurrentUser CurrentUser => LazyGetRequiredService(ref _currentUser); private ICurrentUser _currentUser; @@ -118,8 +121,5 @@ namespace Volo.Abp.AspNetCore.Mvc { ModelValidator?.Validate(ModelState); } - - protected ILogger Logger => _lazyLogger.Value; - private Lazy _lazyLogger => new Lazy(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true); } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs index 98fd94882d..a68a38b274 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs +++ b/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, Id = _currentUser.Id, TenantId = _currentUser.TenantId, - UserName = _currentUser.UserName + UserName = _currentUser.UserName, + Email = _currentUser.Email }; } @@ -226,4 +227,4 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations return result; } } -} \ No newline at end of file +} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/DependencyInjection/AbpAspNetCoreMvcConventionalDependencyRegistrar.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/DependencyInjection/AbpAspNetCoreMvcConventionalDependencyRegistrar.cs index 526470b3ad..2ef536db4d 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/DependencyInjection/AbpAspNetCoreMvcConventionalDependencyRegistrar.cs +++ b/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) { - var serviceDescriptor = ServiceDescriptor.Describe(serviceType, type, lifeTime); - services.Add(serviceDescriptor); + services.Add( + ServiceDescriptor.Describe( + serviceType, + type, + lifeTime + ) + ); } } diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/FodyWeavers.xml b/framework/src/Volo.Abp.AspNetCore.SignalR/FodyWeavers.xml new file mode 100644 index 0000000000..be0de3a908 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.SignalR/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/FodyWeavers.xsd b/framework/src/Volo.Abp.AspNetCore.SignalR/FodyWeavers.xsd new file mode 100644 index 0000000000..3f3946e282 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.SignalR/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/Properties/launchSettings.json b/framework/src/Volo.Abp.AspNetCore.SignalR/Properties/launchSettings.json new file mode 100644 index 0000000000..418c7f2621 --- /dev/null +++ b/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" + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/Volo.Abp.AspNetCore.SignalR.csproj b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo.Abp.AspNetCore.SignalR.csproj new file mode 100644 index 0000000000..f4c833cb90 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo.Abp.AspNetCore.SignalR.csproj @@ -0,0 +1,23 @@ + + + + + + + netcoreapp3.1 + Volo.Abp.AspNetCore.SignalR + Volo.Abp.AspNetCore.SignalR + $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; + false + false + false + true + Library + + + + + + + + diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpAspNetCoreSignalRModule.cs b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpAspNetCoreSignalRModule.cs new file mode 100644 index 0000000000..e26de184af --- /dev/null +++ b/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(options => + { + options.EndpointConfigureActions.Add(endpointContext => + { + var signalROptions = endpointContext + .ScopeServiceProvider + .GetRequiredService>() + .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(); + + services.OnRegistred(context => + { + if (typeof(Hub).IsAssignableFrom(context.ImplementationType)) + { + hubTypes.Add(context.ImplementationType); + } + }); + + services.Configure(options => + { + foreach (var hubType in hubTypes) + { + options.Hubs.Add(HubConfig.Create(hubType)); + } + }); + } + + private void MapHubType( + Type hubType, + IEndpointRouteBuilder endpoints, + string pattern, + Action configureOptions) + { + MapHubGenericMethodInfo + .MakeGenericMethod(hubType) + .Invoke( + this, + new object[] + { + endpoints, + pattern, + configureOptions + } + ); + } + + // ReSharper disable once UnusedMember.Local (used via reflection) + private static void MapHub( + IEndpointRouteBuilder endpoints, + string pattern, + Action configureOptions) + where THub : Hub + { + endpoints.MapHub( + pattern, + configureOptions + ); + } + } +} diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpHub.cs b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpHub.cs new file mode 100644 index 0000000000..a1dc1437ea --- /dev/null +++ b/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(ref TService reference) + => LazyGetRequiredService(typeof(TService), ref reference); + + protected TRef LazyGetRequiredService(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 _lazyLogger => new Lazy(() => 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 : Hub + where T : class + { + public IServiceProvider ServiceProvider { get; set; } + protected readonly object ServiceProviderLock = new object(); + + protected TService LazyGetRequiredService(ref TService reference) + => LazyGetRequiredService(typeof(TService), ref reference); + + protected TRef LazyGetRequiredService(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 _lazyLogger => new Lazy(() => 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); + } +} diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpSignalRConventionalRegistrar.cs b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpSignalRConventionalRegistrar.cs new file mode 100644 index 0000000000..9dcb46d6bc --- /dev/null +++ b/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); + } + } +} diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpSignalROptions.cs b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpSignalROptions.cs new file mode 100644 index 0000000000..c0a07a2ea3 --- /dev/null +++ b/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 Hubs { get; } + + public AbpSignalROptions() + { + Hubs = new List(); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpSignalRUserIdProvider.cs b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpSignalRUserIdProvider.cs new file mode 100644 index 0000000000..10d986933d --- /dev/null +++ b/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(); + } + } +} diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/HubConfig.cs b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/HubConfig.cs new file mode 100644 index 0000000000..59c9342fce --- /dev/null +++ b/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> 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>(); + } + + public static HubConfig Create() + where THub : Hub + { + return Create(typeof(THub)); + } + + public static HubConfig Create(Type hubType) + { + return new HubConfig( + hubType, + HubRouteAttribute.GetRoutePattern(hubType) + ); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/HubRouteAttribute.cs b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/HubRouteAttribute.cs new file mode 100644 index 0000000000..5de916a89d --- /dev/null +++ b/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() + where THub : Hub + { + return GetRoutePattern(typeof(THub)); + } + + public static string GetRoutePattern(Type hubType) + { + var routeAttribute = hubType.GetSingleAttributeOrNull(); + if (routeAttribute != null) + { + return routeAttribute.RoutePattern; + } + + return "/signalr-hubs/" + hubType.Name.RemovePostFix("Hub").ToKebabCase(); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Builder/AbpAspNetCoreApplicationBuilderExtensions.cs b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Builder/AbpAspNetCoreApplicationBuilderExtensions.cs new file mode 100644 index 0000000000..1ce443c37f --- /dev/null +++ b/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 + { + /// + /// Maps endpoints configured with the . + /// It internally uses the standard app.UseEndpoints(...) method. + /// + /// The application builder + /// Additional (and optional) endpoint configuration + /// + public static IApplicationBuilder UseConfiguredEndpoints( + this IApplicationBuilder app, + Action additionalConfigurationAction = null) + { + var options = app.ApplicationServices + .GetRequiredService>() + .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); + } + }); + } + } +} diff --git a/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Routing/AbpEndpointRouterOptions.cs b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Routing/AbpEndpointRouterOptions.cs new file mode 100644 index 0000000000..85c81a7949 --- /dev/null +++ b/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> EndpointConfigureActions { get; } + + public AbpEndpointRouterOptions() + { + EndpointConfigureActions = new List>(); + } + } +} diff --git a/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Routing/EndpointRouteBuilderContext.cs b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Routing/EndpointRouteBuilderContext.cs new file mode 100644 index 0000000000..80f25d2d38 --- /dev/null +++ b/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; + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/VirtualFileSystem/WebContentFileProvider.cs b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/VirtualFileSystem/WebContentFileProvider.cs index 4fab6d0001..898eae546f 100644 --- a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/VirtualFileSystem/WebContentFileProvider.cs +++ b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/VirtualFileSystem/WebContentFileProvider.cs @@ -99,17 +99,14 @@ namespace Volo.Abp.AspNetCore.VirtualFileSystem _virtualFileProvider }; - if (_hostingEnvironment.IsDevelopment() && + if (_hostingEnvironment.IsDevelopment() && _hostingEnvironment.WebRootFileProvider is CompositeFileProvider compositeFileProvider) { - var staticWebAssetsFileProvider = compositeFileProvider + var staticWebAssetsFileProviders = compositeFileProvider .FileProviders - .FirstOrDefault(f => f.GetType().Name.Equals("StaticWebAssetsFileProvider")); + .Where(f => f.GetType().Name.Equals("StaticWebAssetsFileProvider")).ToList(); - if (staticWebAssetsFileProvider != null) - { - fileProviders.Add(staticWebAssetsFileProvider); - } + fileProviders.AddRange(staticWebAssetsFileProviders); } return new CompositeFileProvider( @@ -127,4 +124,4 @@ namespace Volo.Abp.AspNetCore.VirtualFileSystem return Options.AllowedExtraWebContentFileExtensions.Any(e => path.EndsWith(e, StringComparison.OrdinalIgnoreCase)); } } -} \ No newline at end of file +} diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs index 5c732f6873..667aa77757 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs @@ -21,6 +21,7 @@ namespace Volo.Abp.Cli.Commands public static Dictionary> propertyList = new Dictionary>(); public ILogger Logger { get; set; } public static string outputPrefix = "src/app"; + public static string output = ""; protected TemplateProjectBuilder TemplateProjectBuilder { get; } @@ -57,6 +58,12 @@ namespace Volo.Abp.Cli.Commands 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(); string json = ""; try @@ -99,7 +106,10 @@ namespace Volo.Abp.Cli.Commands var rootPath = moduleItem.Key; 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") { @@ -110,7 +120,7 @@ namespace Volo.Abp.Cli.Commands outputPrefix = "src/app"; } - Directory.CreateDirectory($"{outputPrefix}/{rootPath}"); + Directory.CreateDirectory(output + $"{outputPrefix}/{rootPath}"); 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", ""); controllerPathName = (controllerPathName.StartsWith(rootPath)) ? controllerPathName.Substring(rootPath.Length) : controllerPathName; - Directory.CreateDirectory($"{outputPrefix}/{rootPath}/{controllerPathName}/models"); - Directory.CreateDirectory($"{outputPrefix}/{rootPath}/{controllerPathName}/services"); + Directory.CreateDirectory(output + $"{outputPrefix}/{rootPath}/{controllerPathName}/models"); + Directory.CreateDirectory(output + $"{outputPrefix}/{rootPath}/{controllerPathName}/services"); foreach (var actionItem in controller["actions"]) { @@ -240,7 +250,7 @@ namespace Volo.Abp.Cli.Commands foreach (var parameterItem in parameterModel.OrderBy(p => p.DisplayOrder)) { 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)) { parameterItem.Type = "any"; @@ -277,7 +287,7 @@ namespace Volo.Abp.Cli.Commands var secondType = secondTypeArray[secondTypeArray.Length - 1].TrimEnd('>'); 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)) { secondType = "any"; @@ -374,7 +384,7 @@ namespace Volo.Abp.Cli.Commands serviceFileText.AppendLine("}"); 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}';"); } - 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) { @@ -396,7 +406,7 @@ namespace Volo.Abp.Cli.Commands 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("IStringValueType") || returnValueType.Contains("IValueValidator") + || returnValueType.Contains("Guid") ) { return null; @@ -483,7 +494,7 @@ namespace Volo.Abp.Cli.Commands 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(); @@ -513,7 +524,9 @@ namespace Volo.Abp.Cli.Commands baseTypeName = "string"; } + modelFileText.AppendLine(Environment.NewLine); modelFileText.AppendLine($"import {{ {baseTypeName} }} from '{baseTypeKebabCase}';"); + extends = "extends " + (!string.IsNullOrWhiteSpace(customBaseTypeName) ? customBaseTypeName : baseTypeName); var modelIndex = CreateType(data, baseType, rootPath, modelIndexList, controllerPathName); @@ -582,7 +595,7 @@ namespace Volo.Abp.Cli.Commands ) { var typeSimpleModelName = typeSimple.PascalToKebabCase() + ".ts"; - var modelPath = $"{outputPrefix}/{rootPath}/{controllerPathName}/models/{typeSimpleModelName}"; + var modelPath = output + $"{outputPrefix}/{rootPath}/{controllerPathName}/models/{typeSimpleModelName}"; if (!File.Exists(modelPath)) { typeSimple = "any" + (typeSimple.Contains("[]") ? "[]" : ""); @@ -601,14 +614,13 @@ namespace Volo.Abp.Cli.Commands var propertyType = propertyTypeSplit[propertyTypeSplit.Length - 1]; 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; } - - modelFileText.Insert(0, ""); + modelFileText.Insert(0, $"import {{ {propertyType} }} from '{from}';"); - modelFileText.Insert(0, ""); + modelFileText.Insert(0, Environment.NewLine); modelIndexList.Add(modelIndex); } @@ -651,7 +663,7 @@ namespace Volo.Abp.Cli.Commands 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", ""); } @@ -758,6 +770,11 @@ namespace Volo.Abp.Cli.Commands public const string Short = "u"; public const string Long = "ui"; } + public static class Output + { + public const string Short = "o"; + public const string Long = "out"; + } } } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs index ccc0b0e62d..66843bea4f 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs @@ -54,14 +54,8 @@ namespace Volo.Abp.Cli.ProjectBuilding string templateSource = null) { 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 (latestVersion == null) @@ -84,13 +78,7 @@ namespace Volo.Abp.Cli.ProjectBuilding version = latestVersion; } - string nugetVersion; - -#if DEBUG - nugetVersion = version; -#else - nugetVersion = (await GetTemplateNugetVersionAsync(name, type, version)) ?? version; -#endif + var nugetVersion = (await GetTemplateNugetVersionAsync(name, type, version)) ?? version; if (!string.IsNullOrWhiteSpace(templateSource) && !IsNetworkSource(templateSource)) { diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/es.json b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/es.json new file mode 100644 index 0000000000..33c59be8b5 --- /dev/null +++ b/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." + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/zh-Hant.json b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/zh-Hant.json index a66a6d2ff8..2bf2fa5240 100644 --- a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/zh-Hant.json +++ b/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.EnableSsl": "啟用SSL", "DisplayName:Abp.Mailing.Smtp.UseDefaultCredentials": "使用預設憑證", - "Description:Abp.Mailing.DefaultFromAddress": "預設的發信者地址.", - "Description:Abp.Mailing.DefaultFromDisplayName": "預設的發信者名稱.", - "Description:Abp.Mailing.Smtp.Host": "SMTP 服務的主機名稱或主機IP位址.", + "Description:Abp.Mailing.DefaultFromAddress": "預設發信者地址.", + "Description:Abp.Mailing.DefaultFromDisplayName": "預設發信者名稱.", + "Description:Abp.Mailing.Smtp.Host": "SMTP 服務的主機名稱或IP位址.", "Description:Abp.Mailing.Smtp.Port": "SMTP 服務的埠號.", "Description:Abp.Mailing.Smtp.UserName": "憑證使用者名稱.", "Description:Abp.Mailing.Smtp.Password": "憑證使用者密碼.", - "Description:Abp.Mailing.Smtp.Domain": "驗證憑證的網域名稱或電腦名稱.", - "Description:Abp.Mailing.Smtp.EnableSsl": "設定 SmtpClient 是否使用安全通訊協定.", - "Description:Abp.Mailing.Smtp.UseDefaultCredentials": "設定是否使用預設憑證." + "Description:Abp.Mailing.Smtp.Domain": "驗證憑證的網域或電腦名稱.", + "Description:Abp.Mailing.Smtp.EnableSsl": "指定 SmtpClient 是否使用安全通訊(SSL)協定.", + "Description:Abp.Mailing.Smtp.UseDefaultCredentials": "設定是否使用預設憑證.", + "TextTemplate:StandardEmailTemplates.Layout": "預設的電子郵件樣式", + "TextTemplate:StandardEmailTemplates.Message": "電子郵件內的文字訊息" } -} \ No newline at end of file +} diff --git a/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/AbpDbContextConfigurationContextPostgreSqlExtensions.cs b/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/AbpDbContextConfigurationContextPostgreSqlExtensions.cs index 1f86dfa480..9ab28dddcb 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/AbpDbContextConfigurationContextPostgreSqlExtensions.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/AbpDbContextConfigurationContextPostgreSqlExtensions.cs @@ -8,9 +8,17 @@ namespace Volo.Abp.EntityFrameworkCore { public static class AbpDbContextConfigurationContextPostgreSqlExtensions { + [Obsolete("Use 'UseNpgsql(...)' method instead. This will be removed in future versions.")] public static DbContextOptionsBuilder UsePostgreSql( [NotNull] this AbpDbContextConfigurationContext context, [CanBeNull] Action postgreSqlOptionsAction = null) + { + return context.UseNpgsql(postgreSqlOptionsAction); + } + + public static DbContextOptionsBuilder UseNpgsql( + [NotNull] this AbpDbContextConfigurationContext context, + [CanBeNull] Action postgreSqlOptionsAction = null) { if (context.ExistingConnection != null) { diff --git a/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/AbpDbContextOptionsPostgreSqlExtensions.cs b/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/AbpDbContextOptionsPostgreSqlExtensions.cs index 47967de15d..5fd6d0d6b9 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/AbpDbContextOptionsPostgreSqlExtensions.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/AbpDbContextOptionsPostgreSqlExtensions.cs @@ -6,16 +6,18 @@ namespace Volo.Abp.EntityFrameworkCore { public static class AbpDbContextOptionsPostgreSqlExtensions { + [Obsolete("Use 'UseNpgsql(...)' method instead. This will be removed in future versions.")] public static void UsePostgreSql( [NotNull] this AbpDbContextOptions options, [CanBeNull] Action postgreSqlOptionsAction = null) { 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( [NotNull] this AbpDbContextOptions options, [CanBeNull] Action postgreSqlOptionsAction = null) @@ -23,7 +25,28 @@ namespace Volo.Abp.EntityFrameworkCore { options.Configure(context => { - context.UsePostgreSql(postgreSqlOptionsAction); + context.UseNpgsql(postgreSqlOptionsAction); + }); + } + + public static void UseNpgsql( + [NotNull] this AbpDbContextOptions options, + [CanBeNull] Action postgreSqlOptionsAction = null) + { + options.Configure(context => + { + context.UseNpgsql(postgreSqlOptionsAction); + }); + } + + public static void UseNpgsql( + [NotNull] this AbpDbContextOptions options, + [CanBeNull] Action postgreSqlOptionsAction = null) + where TDbContext : AbpDbContext + { + options.Configure(context => + { + context.UseNpgsql(postgreSqlOptionsAction); }); } } diff --git a/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj b/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj index 0fd10d94ca..88c3bf0e81 100644 --- a/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj +++ b/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj @@ -28,5 +28,4 @@ - diff --git a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ObjectExtensionManager.cs b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ObjectExtensionManager.cs index 2b0ce8977d..fcc6fddbd0 100644 --- a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ObjectExtensionManager.cs +++ b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ObjectExtensionManager.cs @@ -9,7 +9,7 @@ namespace Volo.Abp.ObjectExtending { public class ObjectExtensionManager { - public static ObjectExtensionManager Instance { get; set; } = new ObjectExtensionManager(); + public static ObjectExtensionManager Instance { get; protected set; } = new ObjectExtensionManager(); [NotNull] public ConcurrentDictionary Configuration { get; } diff --git a/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/VirtualFiles/LocalizedTemplateContentReaderFactory.cs b/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/VirtualFiles/LocalizedTemplateContentReaderFactory.cs index b30e5771f4..092815ff6e 100644 --- a/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/VirtualFiles/LocalizedTemplateContentReaderFactory.cs +++ b/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.Tasks; using Volo.Abp.DependencyInjection; @@ -42,12 +41,18 @@ namespace Volo.Abp.TextTemplating.VirtualFiles } finally { - _lock.ExitWriteLock(); + if (_lock.IsWriteLockHeld) + { + _lock.ExitWriteLock(); + } } } finally { - _lock.ExitUpgradeableReadLock(); + if (_lock.IsUpgradeableReadLockHeld) + { + _lock.ExitUpgradeableReadLock(); + } } } diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/es.json b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/es.json index ba27a9193c..0fc6660fac 100644 --- a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/es.json +++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/es.json @@ -1,6 +1,6 @@ { "culture": "es", "texts": { - "Menu:Administration": "Administración" + "Menu:Administration": "Administración" } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/es.json b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/es.json index b52c56510b..be137f013b 100644 --- a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/es.json +++ b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/es.json @@ -1,20 +1,20 @@ { "culture": "es", "texts": { - "InternalServerErrorMessage": "Ocurrió un error interno en su pedido!", - "ValidationErrorMessage": "Su pedido no es válido!", - "ValidationNarrativeErrorMessageTitle": "Los siguientes errores se encontraton durante la validación.", - "DefaultErrorMessage": "Ocurrió un error!", - "DefaultErrorMessageDetail": "El servidor no envió el detalle del error.", - "DefaultErrorMessage401": "Usted no ha iniciado sessión!", - "DefaultErrorMessage401Detail": "Debe iniciar sessión para ejecutar esta operación.", - "DefaultErrorMessage403": "Usted no está autorizado!", - "DefaultErrorMessage403Detail": "Usted no puede hacer esta operación!", - "DefaultErrorMessage404": "No se encontró el recurso!", - "DefaultErrorMessage404Detail": "El recurso solicitado no se encontró en el servidor!", + "InternalServerErrorMessage": "Ocurrió un error interno en su pedido!", + "ValidationErrorMessage": "Su pedido no es válido!", + "ValidationNarrativeErrorMessageTitle": "Los siguientes errores se encontraton durante la validación.", + "DefaultErrorMessage": "Ocurrió un error!", + "DefaultErrorMessageDetail": "El servidor no envió el detalle del error.", + "DefaultErrorMessage401": "Usted no ha iniciado sessión!", + "DefaultErrorMessage401Detail": "Debe iniciar sessión para ejecutar esta operación.", + "DefaultErrorMessage403": "Usted no está autorizado!", + "DefaultErrorMessage403Detail": "Usted no puede hacer esta operación!", + "DefaultErrorMessage404": "No se encontró el recurso!", + "DefaultErrorMessage404Detail": "El recurso solicitado no se encontró en el servidor!", "EntityNotFoundErrorMessage": "No hay una entidad {0} con el id = {1}!", "Error": "Error", - "AreYouSure": "¿Está seguro?", + "AreYouSure": "¿Está seguro?", "Cancel": "Cancelar", "Yes": "Si", "No": "No", @@ -30,14 +30,14 @@ "Welcome": "Bienvenido", "Login": "Iniciar session", "Register": "Registrarse", - "Logout": "Cerrar sessión", + "Logout": "Cerrar sessión", "Submit": "Enviar", - "Back": "Atrás", + "Back": "Atrás", "PagerSearch": "Buscar", "PagerNext": "Siguiente", "PagerPrevious": "Anterior", "PagerFirst": "Primero", - "PagerLast": "Último", + "PagerLast": "Último", "PagerInfo": "Mostrando desde _START_ hasta _END_ total _TOTAL_", "PagerInfo{0}{1}{2}": "Mostrando desde {0} hasta {1} total {2}", "PagerInfoEmpty": "Mostrando desde 0 hasta 0 de 0 registros", @@ -45,15 +45,15 @@ "NoDataAvailableInDatatable": "No hay datos", "PagerShowMenuEntries": "Mostrar _MENU_ registros", "DatatableActionDropdownDefaultText": "Acciones", - "ChangePassword": "Cambiar contraseña", + "ChangePassword": "Cambiar contraseña", "PersonalInfo": "My perfil", "AreYouSureYouWantToCancelEditingWarningMessage": "Tiene cambios sin guardar.", - "UnhandledException": "Excepción no controlada!", + "UnhandledException": "Excepción no controlada!", "401Message": "No autorizado", "403Message": "Prohibido", - "404Message": "La página no existe", + "404Message": "La página no existe", "500Message": "Error interno del servidor", - "GoHomePage": "Ir a la página principal", + "GoHomePage": "Ir a la página principal", "GoBack": "Atras" } } diff --git a/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWorkManager.cs b/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWorkManager.cs index 479cf45117..0a1fcc7a9f 100644 --- a/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWorkManager.cs +++ b/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; namespace Volo.Abp.Uow diff --git a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/es.json b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/es.json index 3f84a158aa..bb7cb733fe 100644 --- a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/es.json +++ b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/es.json @@ -1,4 +1,4 @@ -{ +{ "culture": "es", "texts": { "'{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 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 {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 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.", diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs index 39b7d9af5f..90930abc6d 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs +++ b/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.UseAuditing(); app.UseUnitOfWork(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/AbpAspNetCoreMvcUiBootstrapDemoModule.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/AbpAspNetCoreMvcUiBootstrapDemoModule.cs index e14e2336d9..90780d3687 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/AbpAspNetCoreMvcUiBootstrapDemoModule.cs +++ b/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.UseVirtualFiles(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/AbpAspNetCoreMvcUiThemeBasicDemoModule.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/AbpAspNetCoreMvcUiThemeBasicDemoModule.cs index 758985bb27..9af261e3c8 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/AbpAspNetCoreMvcUiThemeBasicDemoModule.cs +++ b/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.UseRouting(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/AbpAspNetCoreMvcVersioningTestModule.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/AbpAspNetCoreMvcVersioningTestModule.cs index b06a90bcfa..4e28d77a0a 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/AbpAspNetCoreMvcVersioningTestModule.cs +++ b/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(); app.UseRouting(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/framework/test/Volo.Abp.AspNetCore.Serilog.Tests/Volo/Abp/AspNetCore/App/AbpSerilogTestModule.cs b/framework/test/Volo.Abp.AspNetCore.Serilog.Tests/Volo/Abp/AspNetCore/App/AbpSerilogTestModule.cs index 557288cd7d..8c7ed40dc7 100644 --- a/framework/test/Volo.Abp.AspNetCore.Serilog.Tests/Volo/Abp/AspNetCore/App/AbpSerilogTestModule.cs +++ b/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.UseAuditing(); app.UseAbpSerilogEnrichers(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/es.json b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/es.json index d9b29895b8..13a6c2db61 100644 --- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/es.json +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/es.json @@ -1,4 +1,4 @@ -{ +{ "culture": "es", "texts": { "USA": "Estados unidos de América", diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/es.json b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/es.json index 04e85b5f12..a83091e2c8 100644 --- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/es.json +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/es.json @@ -1,4 +1,4 @@ -{ +{ "culture": "es", "texts": { "ThisFieldIsRequired": "El campo no puede estar vacío", diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/es.json b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/es.json index 7b68ff6f2c..f68ed052c3 100644 --- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/es.json +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/es.json @@ -1,4 +1,4 @@ -{ +{ "culture": "es", "texts": { "Hello {0}.": "Hola {0}.", diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/es.json b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/es.json new file mode 100644 index 0000000000..43554b2311 --- /dev/null +++ b/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." + } +} \ No newline at end of file diff --git a/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs b/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs index dbaefdc1a5..8d57cb8aee 100644 --- a/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs +++ b/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs @@ -158,7 +158,7 @@ namespace Volo.BloggingTestApp app.UseRequestLocalization(app.ApplicationServices.GetRequiredService>().Value); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); using (var scope = context.ServiceProvider.CreateScope()) diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Index.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Index.cshtml index 5a8f9bd694..61d9827c47 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Index.cshtml +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Index.cshtml @@ -59,8 +59,8 @@
@post.Writer.UserName @ConvertDatetimeToTimeAgo(post.CreationTime)
@L["WiewsWithCount", post.ReadCount] - | - @L["CommentWithCount", post.CommentCount] + @*| + @L["CommentWithCount", post.CommentCount]*@
@@ -116,8 +116,8 @@
@post.Writer.UserName @ConvertDatetimeToTimeAgo(post.CreationTime)
} @L["WiewsWithCount", post.ReadCount] - | - @L["CommentWithCount", post.CommentCount] + @*| + @L["CommentWithCount", post.CommentCount]*@ @@ -177,8 +177,8 @@
@post.Writer.UserName @ConvertDatetimeToTimeAgo(post.CreationTime)
@L["WiewsWithCount", post.ReadCount] - | - @L["CommentWithCount", post.CommentCount] + @*| + @L["CommentWithCount", post.CommentCount]*@
diff --git a/modules/client-simulation/demo/Volo.ClientSimulation.Demo/ClientSimulationDemoModule.cs b/modules/client-simulation/demo/Volo.ClientSimulation.Demo/ClientSimulationDemoModule.cs index afc29ccb3f..2c3fae2dff 100644 --- a/modules/client-simulation/demo/Volo.ClientSimulation.Demo/ClientSimulationDemoModule.cs +++ b/modules/client-simulation/demo/Volo.ClientSimulation.Demo/ClientSimulationDemoModule.cs @@ -42,7 +42,7 @@ namespace Volo.ClientSimulation.Demo app.UseVirtualFiles(); app.UseRouting(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs b/modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs index 0c8e5354b6..d9673269b3 100644 --- a/modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs +++ b/modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs @@ -167,7 +167,7 @@ namespace VoloDocs.Web //app.UseMiddleware(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); using (var scope = context.ServiceProvider.CreateScope()) { diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo.Abp.IdentityServer.Domain.csproj b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo.Abp.IdentityServer.Domain.csproj index 3ad4d2bb05..0fbb06c694 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo.Abp.IdentityServer.Domain.csproj +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo.Abp.IdentityServer.Domain.csproj @@ -25,8 +25,8 @@ - - + + diff --git a/npm/ng-packs/packages/core/src/lib/models/application-configuration.ts b/npm/ng-packs/packages/core/src/lib/models/application-configuration.ts index 0a4377f4d2..b52afe9faf 100644 --- a/npm/ng-packs/packages/core/src/lib/models/application-configuration.ts +++ b/npm/ng-packs/packages/core/src/lib/models/application-configuration.ts @@ -66,5 +66,6 @@ export namespace ApplicationConfiguration { id: string; tenantId: string; userName: string; + email: string; } } diff --git a/npm/ng-packs/packages/core/src/lib/states/config.state.ts b/npm/ng-packs/packages/core/src/lib/states/config.state.ts index af706586bb..546b3d0b1e 100644 --- a/npm/ng-packs/packages/core/src/lib/states/config.state.ts +++ b/npm/ng-packs/packages/core/src/lib/states/config.state.ts @@ -324,7 +324,7 @@ function patchRouteDeep( ): ABP.FullRoute[] { routes = routes.map(route => { if (route.name === name) { - newValue.url = `${parentUrl}/${(!newValue.path && newValue.path === '' + newValue.url = `${parentUrl}/${(!newValue.path || newValue.path === '' ? route.path : newValue.path) || ''}`; diff --git a/npm/ng-packs/packages/core/src/lib/tests/config-state.service.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/config-state.service.spec.ts index d019bda84b..17de9efb9e 100644 --- a/npm/ng-packs/packages/core/src/lib/tests/config-state.service.spec.ts +++ b/npm/ng-packs/packages/core/src/lib/tests/config-state.service.spec.ts @@ -122,6 +122,7 @@ const CONFIG_STATE_DATA = { id: null, tenantId: null, userName: null, + email: null, }, features: { values: {}, diff --git a/npm/ng-packs/packages/core/src/lib/tests/config.state.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/config.state.spec.ts index 3df3abc63e..aa3740218c 100644 --- a/npm/ng-packs/packages/core/src/lib/tests/config.state.spec.ts +++ b/npm/ng-packs/packages/core/src/lib/tests/config.state.spec.ts @@ -146,6 +146,7 @@ export const CONFIG_STATE_DATA = { id: null, tenantId: null, userName: null, + email: null, }, features: { values: {}, diff --git a/npm/ng-packs/scripts/publish.ts b/npm/ng-packs/scripts/publish.ts index 5570602813..9228a752ca 100644 --- a/npm/ng-packs/scripts/publish.ts +++ b/npm/ng-packs/scripts/publish.ts @@ -28,7 +28,15 @@ const publish = async () => { await execa( '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: '../' }, ); diff --git a/npm/packs/prismjs/package.json b/npm/packs/prismjs/package.json index 1c53989fe5..ea92abe767 100644 --- a/npm/packs/prismjs/package.json +++ b/npm/packs/prismjs/package.json @@ -6,6 +6,7 @@ }, "dependencies": { "@abp/core": "^2.7.0", + "@abp/clipboard": "^2.7.0", "prismjs": "^1.17.1" }, "gitHead": "0ea3895f3b0b489e3ea81fc88f8f0896b22b61bd" diff --git a/npm/packs/signalr/abp.resourcemapping.js b/npm/packs/signalr/abp.resourcemapping.js new file mode 100644 index 0000000000..69ef9ca16a --- /dev/null +++ b/npm/packs/signalr/abp.resourcemapping.js @@ -0,0 +1,5 @@ +module.exports = { + mappings: { + "@node_modules/@microsoft/signalr/dist/browser/*.*": "@libs/signalr/browser/" + } +} \ No newline at end of file diff --git a/npm/packs/signalr/package.json b/npm/packs/signalr/package.json new file mode 100644 index 0000000000..67ac59402c --- /dev/null +++ b/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" +} diff --git a/nupkg/common.ps1 b/nupkg/common.ps1 index 6dfe0041aa..661f630a0b 100644 --- a/nupkg/common.ps1 +++ b/nupkg/common.ps1 @@ -41,6 +41,7 @@ $projects = ( "framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared", "framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets", "framework/src/Volo.Abp.AspNetCore.Serilog", + "framework/src/Volo.Abp.AspNetCore.SignalR", "framework/src/Volo.Abp.AspNetCore.TestBase", "framework/src/Volo.Abp.Auditing", "framework/src/Volo.Abp.Authorization", diff --git a/samples/MicroserviceDemo/applications/AuthServer.Host/AuthServerHostModule.cs b/samples/MicroserviceDemo/applications/AuthServer.Host/AuthServerHostModule.cs index 8a132b2cac..08b6689cea 100644 --- a/samples/MicroserviceDemo/applications/AuthServer.Host/AuthServerHostModule.cs +++ b/samples/MicroserviceDemo/applications/AuthServer.Host/AuthServerHostModule.cs @@ -102,7 +102,7 @@ namespace AuthServer.Host app.UseIdentityServer(); app.UseAbpRequestLocalization(); app.UseAuditing(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); //TODO: Problem on a clustered environment AsyncHelper.RunSync(async () => diff --git a/samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminAppHostModule.cs b/samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminAppHostModule.cs index d6c076cea3..b0aba5af53 100644 --- a/samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminAppHostModule.cs +++ b/samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminAppHostModule.cs @@ -130,7 +130,7 @@ namespace BackendAdminApp.Host { options.SwaggerEndpoint("/swagger/v1/swagger.json", "Backend Admin Application API"); }); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSiteHostModule.cs b/samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSiteHostModule.cs index a7e236e2d2..bc0bb83021 100644 --- a/samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSiteHostModule.cs +++ b/samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSiteHostModule.cs @@ -103,7 +103,7 @@ namespace PublicWebSite.Host } app.UseAuthorization(); app.UseAbpRequestLocalization(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGatewayHostModule.cs b/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGatewayHostModule.cs index c2e7150d96..7edcd7f29a 100644 --- a/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGatewayHostModule.cs +++ b/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGatewayHostModule.cs @@ -141,7 +141,7 @@ namespace BackendAdminAppGateway.Host app2 => { app2.UseRouting(); - app2.UseMvcWithDefaultRouteAndArea(); + app2.UseConfiguredEndpoints(); } ); diff --git a/samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGatewayHostModule.cs b/samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGatewayHostModule.cs index fd72854c6b..dcad85fa57 100644 --- a/samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGatewayHostModule.cs +++ b/samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGatewayHostModule.cs @@ -122,7 +122,7 @@ namespace InternalGateway.Host app2 => { app2.UseRouting(); - app2.UseMvcWithDefaultRouteAndArea(); + app2.UseConfiguredEndpoints(); } ); diff --git a/samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGatewayHostModule.cs b/samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGatewayHostModule.cs index 85abd1211c..2bd570d56d 100644 --- a/samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGatewayHostModule.cs +++ b/samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGatewayHostModule.cs @@ -116,7 +116,7 @@ namespace PublicWebSiteGateway.Host app2 => { app2.UseRouting(); - app2.UseMvcWithDefaultRouteAndArea(); + app2.UseConfiguredEndpoints(); } ); diff --git a/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingServiceHostModule.cs b/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingServiceHostModule.cs index 4c5b7b6d3b..692d4c3d61 100644 --- a/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingServiceHostModule.cs +++ b/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingServiceHostModule.cs @@ -13,6 +13,7 @@ using MsDemo.Shared; using Swashbuckle.AspNetCore.Swagger; using Volo.Abp; using Volo.Abp.AspNetCore.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Auditing; using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.Autofac; @@ -40,6 +41,7 @@ namespace BloggingService.Host { [DependsOn( typeof(AbpAutofacModule), + typeof(AbpAspNetCoreMvcModule), typeof(AbpEventBusRabbitMqModule), typeof(AbpEntityFrameworkCoreSqlServerModule), typeof(AbpAuditLoggingEntityFrameworkCoreModule), @@ -145,7 +147,7 @@ namespace BloggingService.Host options.SwaggerEndpoint("/swagger/v1/swagger.json", "Blogging Service API"); }); app.UseAuditing(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); //TODO: Problem on a clustered environment AsyncHelper.RunSync(async () => diff --git a/samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityServiceHostModule.cs b/samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityServiceHostModule.cs index 7cc864b4bb..982f4c09af 100644 --- a/samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityServiceHostModule.cs +++ b/samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityServiceHostModule.cs @@ -9,6 +9,7 @@ using Microsoft.OpenApi.Models; using MsDemo.Shared; using Volo.Abp; using Volo.Abp.AspNetCore.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Auditing; using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.Autofac; @@ -29,6 +30,7 @@ namespace IdentityService.Host { [DependsOn( typeof(AbpAutofacModule), + typeof(AbpAspNetCoreMvcModule), typeof(AbpEventBusRabbitMqModule), typeof(AbpEntityFrameworkCoreSqlServerModule), typeof(AbpAuditLoggingEntityFrameworkCoreModule), @@ -126,7 +128,7 @@ namespace IdentityService.Host options.SwaggerEndpoint("/swagger/v1/swagger.json", "Identity Service API"); }); app.UseAuditing(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/samples/MicroserviceDemo/microservices/ProductService.Host/ProductServiceHostModule.cs b/samples/MicroserviceDemo/microservices/ProductService.Host/ProductServiceHostModule.cs index e03cf26182..44e23eeb78 100644 --- a/samples/MicroserviceDemo/microservices/ProductService.Host/ProductServiceHostModule.cs +++ b/samples/MicroserviceDemo/microservices/ProductService.Host/ProductServiceHostModule.cs @@ -12,6 +12,7 @@ using MsDemo.Shared; using Swashbuckle.AspNetCore.Swagger; using Volo.Abp; using Volo.Abp.AspNetCore.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Auditing; using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.Autofac; @@ -32,6 +33,7 @@ namespace ProductService.Host { [DependsOn( typeof(AbpAutofacModule), + typeof(AbpAspNetCoreMvcModule), typeof(AbpEventBusRabbitMqModule), typeof(AbpEntityFrameworkCoreSqlServerModule), typeof(AbpAuditLoggingEntityFrameworkCoreModule), @@ -129,7 +131,7 @@ namespace ProductService.Host options.SwaggerEndpoint("/swagger/v1/swagger.json", "Product Service API"); }); app.UseAuditing(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); //TODO: Problem on a clustered environment AsyncHelper.RunSync(async () => diff --git a/samples/MicroserviceDemo/microservices/TenantManagementService.Host/TenantManagementServiceHostModule.cs b/samples/MicroserviceDemo/microservices/TenantManagementService.Host/TenantManagementServiceHostModule.cs index b60daf710e..f9a818234f 100644 --- a/samples/MicroserviceDemo/microservices/TenantManagementService.Host/TenantManagementServiceHostModule.cs +++ b/samples/MicroserviceDemo/microservices/TenantManagementService.Host/TenantManagementServiceHostModule.cs @@ -9,6 +9,7 @@ using MsDemo.Shared; using StackExchange.Redis; using Volo.Abp; using Volo.Abp.AspNetCore.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Auditing; using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.Autofac; @@ -29,6 +30,7 @@ namespace TenantManagementService.Host { [DependsOn( typeof(AbpAutofacModule), + typeof(AbpAspNetCoreMvcModule), typeof(AbpEventBusRabbitMqModule), typeof(AbpEntityFrameworkCoreSqlServerModule), typeof(AbpAuditLoggingEntityFrameworkCoreModule), @@ -130,7 +132,7 @@ namespace TenantManagementService.Host options.SwaggerEndpoint("/swagger/v1/swagger.json", "Tenant Management Service API"); }); app.UseAuditing(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs index edbece71e0..2526aec04d 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs +++ b/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.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AspNetCore.Serilog; using Volo.Abp.Autofac; using Volo.Abp.Caching; @@ -162,6 +163,16 @@ namespace MyCompanyName.MyProjectName public override void OnApplicationInitialization(ApplicationInitializationContext context) { var app = context.GetApplicationBuilder(); + var env = context.GetEnvironment(); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + app.UseErrorPage(); + } app.UseCorrelationId(); app.UseVirtualFiles(); @@ -183,7 +194,7 @@ namespace MyCompanyName.MyProjectName app.UseAuditing(); app.UseAbpSerilogEnrichers(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs index ad2df2e528..7a40f2eef5 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs @@ -188,7 +188,7 @@ namespace MyCompanyName.MyProjectName app.UseAuditing(); app.UseAbpSerilogEnrichers(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs index f7ef3f23eb..0a87b21a31 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs @@ -164,7 +164,7 @@ namespace MyCompanyName.MyProjectName app.UseAbpRequestLocalization(); app.UseAuditing(); app.UseAbpSerilogEnrichers(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs index 66273114fb..0809a70cc4 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs @@ -213,8 +213,6 @@ namespace MyCompanyName.MyProjectName.Web var app = context.GetApplicationBuilder(); var env = context.GetEnvironment(); - app.UseCorrelationId(); - if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); @@ -224,6 +222,7 @@ namespace MyCompanyName.MyProjectName.Web app.UseErrorPage(); } + app.UseCorrelationId(); app.UseVirtualFiles(); app.UseRouting(); app.UseAuthentication(); @@ -246,7 +245,7 @@ namespace MyCompanyName.MyProjectName.Web app.UseAuditing(); app.UseAbpSerilogEnrichers(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs index 4a588d4945..8330951dfc 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs @@ -192,8 +192,6 @@ namespace MyCompanyName.MyProjectName.Web var app = context.GetApplicationBuilder(); var env = context.GetEnvironment(); - app.UseCorrelationId(); - if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); @@ -202,6 +200,8 @@ namespace MyCompanyName.MyProjectName.Web { app.UseErrorPage(); } + + app.UseCorrelationId(); app.UseVirtualFiles(); app.UseRouting(); app.UseAuthentication(); @@ -221,7 +221,7 @@ namespace MyCompanyName.MyProjectName.Web }); app.UseAuditing(); app.UseAbpSerilogEnrichers(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.Web.Tests/MyProjectNameWebTestModule.cs b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.Web.Tests/MyProjectNameWebTestModule.cs index f3998e71dc..20f7e793c2 100644 --- a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.Web.Tests/MyProjectNameWebTestModule.cs +++ b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.Web.Tests/MyProjectNameWebTestModule.cs @@ -107,7 +107,7 @@ namespace MyCompanyName.MyProjectName } }); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } \ No newline at end of file diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs index bb63eed520..e425512797 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs +++ b/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.AspNetCore.MultiTenancy; using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AspNetCore.Serilog; using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.Autofac; @@ -147,11 +148,18 @@ namespace MyCompanyName.MyProjectName public override void OnApplicationInitialization(ApplicationInitializationContext context) { var app = context.GetApplicationBuilder(); + var env = context.GetEnvironment(); - if (!context.GetEnvironment().IsDevelopment()) + if (env.IsDevelopment()) { + app.UseDeveloperExceptionPage(); + } + else + { + app.UseErrorPage(); app.UseHsts(); } + app.UseHttpsRedirection(); app.UseCorrelationId(); app.UseVirtualFiles(); @@ -171,7 +179,7 @@ namespace MyCompanyName.MyProjectName }); app.UseAuditing(); app.UseAbpSerilogEnrichers(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs index 1085d796f5..9d0cb8397c 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs +++ b/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.UI.MultiTenancy; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AspNetCore.Serilog; using Volo.Abp.Auditing; using Volo.Abp.AuditLogging.EntityFrameworkCore; @@ -168,11 +169,18 @@ namespace MyCompanyName.MyProjectName public override void OnApplicationInitialization(ApplicationInitializationContext context) { var app = context.GetApplicationBuilder(); + var env = context.GetEnvironment(); - if (!context.GetEnvironment().IsDevelopment()) + if (env.IsDevelopment()) { + app.UseDeveloperExceptionPage(); + } + else + { + app.UseErrorPage(); app.UseHsts(); } + app.UseHttpsRedirection(); app.UseCorrelationId(); app.UseVirtualFiles(); @@ -194,7 +202,7 @@ namespace MyCompanyName.MyProjectName }); app.UseAuditing(); app.UseAbpSerilogEnrichers(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); SeedData(context); } diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs index 8576829c5d..385b840e75 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs @@ -253,7 +253,7 @@ namespace MyCompanyName.MyProjectName app.UseAuditing(); app.UseAbpSerilogEnrichers(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs index c7daebdc7b..48b0667350 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs @@ -112,8 +112,9 @@ namespace MyCompanyName.MyProjectName public override void OnApplicationInitialization(ApplicationInitializationContext context) { var app = context.GetApplicationBuilder(); + var env = context.GetEnvironment(); - if (context.GetEnvironment().IsDevelopment()) + if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } @@ -142,7 +143,7 @@ namespace MyCompanyName.MyProjectName app.UseAbpRequestLocalization(); app.UseAuditing(); app.UseAbpSerilogEnrichers(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); using (var scope = context.ServiceProvider.CreateScope()) {