diff --git a/docs/en/CLI.md b/docs/en/CLI.md index 6c903575db..a1c53e0407 100644 --- a/docs/en/CLI.md +++ b/docs/en/CLI.md @@ -55,6 +55,7 @@ abp new Acme.BookStore * `--no-ui`: Specifies to not include the UI. This makes possible to create service-only modules (a.k.a. microservices - without UI). * `--output-folder` or `-o`: Specifies the output folder. Default value is the current directory. * `--version` or `-v`: Specifies the ABP & template version. It can be a [release tag](https://github.com/abpframework/abp/releases) or a [branch name](https://github.com/abpframework/abp/branches). Uses the latest release if not specified. Most of the times, you will want to use the latest version. +* `--template-source` or `-ts`: Specifies a custom template source to use to build the project. Local and network sources can be used(Like `D\localTemplate` or `https://.zip`). ### add-package @@ -128,9 +129,35 @@ abp update [options] * `--npm`: Only updates NPM packages. * `--nuget`: Only updates NuGet packages. +### switch-to-preview + +You can use this command to switch your project to latest preview version of the ABP framework packages. + +Usage: + +````bash +abp switch-to-preview [options] +```` +#### Options + +`--solution-path` or `-sp`: Specifies the solution (.sln) file path. If not specified, CLI tries to find a .sln file in the current directory. + +### switch-to-stable + +If you're using the ABP Framework preview packages, you can switch back to stable version using this command. + +Usage: + +````bash +abp switch-to-stable [options] +```` +#### Options + +`--solution-path` or `-sp`: Specifies the solution (.sln) file path. If not specified, CLI tries to find a .sln file in the current directory. + ### login -Some features of the CLI requires to be logged in to abp.io platform. To login with your username write +Some features of the CLI requires to be logged in to abp.io platform. To login with your username write: ```bash abp login diff --git a/docs/zh-Hans/CLI.md b/docs/zh-Hans/CLI.md index 863c061209..69ca39880a 100644 --- a/docs/zh-Hans/CLI.md +++ b/docs/zh-Hans/CLI.md @@ -43,7 +43,7 @@ abp new Acme.BookStore * `app` (default): [应用程序模板](Startup-Templates/Application.md). 其他选项: * `--ui` 或者 `-u`: 指定ui框架.默认`mvc`框架.其他选项: * `mvc`: ASP.NET Core MVC.此模板的其他选项: - * `--tiered`: 创建分层解决方案,Web和Http Api层在物理上是分开的.如果未指定会创建一个分层的解决方案,此解决方案没有那么复杂,适合大多数场景. + * `--tiered`: 创建分层解决方案,Web和Http Api层在物理上是分开的.如果未指定会创建一个分层的解决方案,此解决方案没有那么复杂,适合大多数场景. * `angular`: Angular. 这个模板还有一些额外的选项: * `--separate-identity-server`: 将Identity Server应用程序与API host应用程序分开. 如果未指定,则服务器端将只有一个端点. * `none`: 无UI. 这个模板还有一些额外的选项: @@ -53,8 +53,9 @@ abp new Acme.BookStore * `mongodb`: MongoDB. * `module`: [Module template](Startup-Templates/Module.md). 其他选项: * `--no-ui`: 不包含UI.仅创建服务模块(也称为微服务 - 没有UI). -* `--output-folder` 或者 `-o`: 指定输出文件夹,默认是当前目录. -* `--version` 或者 `-v`: 指定ABP和模板的版本.它可以是 [release tag](https://github.com/abpframework/abp/releases) 或者 [branch name](https://github.com/abpframework/abp/branches). 如果没有指定,则使用最新版本.大多数情况下,您会希望使用最新的版本. +* `--output-folder` 或者 `-o`: 指定输出文件夹,默认是当前目录. +* `--version` 或者 `-v`: 指定ABP和模板的版本.它可以是 [release tag](https://github.com/abpframework/abp/releases) 或者 [branch name](https://github.com/abpframework/abp/branches). 如果没有指定,则使用最新版本.大多数情况下,您会希望使用最新的版本. +* `--template-source` 或者 `-ts`: 指定自定义模板源用于生成项目,可以使用本地源和网络源(例如 `D\localTemplate` 或 `https://.zip`). ### add-package diff --git a/framework/Volo.Abp.sln b/framework/Volo.Abp.sln index 5fdd9a7ee3..88c8385b63 100644 --- a/framework/Volo.Abp.sln +++ b/framework/Volo.Abp.sln @@ -261,9 +261,19 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Serilog EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Serilog.Tests", "test\Volo.Abp.AspNetCore.Serilog.Tests\Volo.Abp.AspNetCore.Serilog.Tests.csproj", "{9CAA07ED-FE5C-4427-A6FA-6C6CB5B4CC62}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo", "src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo\Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.csproj", "{29E42ADB-85F8-44AE-A9B0-078F84C1B866}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Http.Client.IdentityModel.Web", "src\Volo.Abp.Http.Client.IdentityModel.Web\Volo.Abp.Http.Client.IdentityModel.Web.csproj", "{925AF101-2203-409C-9C3B-03917316858F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo", "test\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.csproj", "{0C498CF2-D052-4BF7-AD35-509A90F69707}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.BackgroundJobs.Quartz", "src\Volo.Abp.BackgroundJobs.Quartz\Volo.Abp.BackgroundJobs.Quartz.csproj", "{2307198B-5837-4F05-AA84-D6EC2A923D69}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Quartz", "src\Volo.Abp.Quartz\Volo.Abp.Quartz.csproj", "{9467418B-4A9B-4093-9B31-01A9DEF5B372}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.BackgroundWorkers.Quartz", "src\Volo.Abp.BackgroundWorkers.Quartz\Volo.Abp.BackgroundWorkers.Quartz.csproj", "{CD5770BB-2E0C-4B3C-80E0-21B8CC43DBA9}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo", "src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo\Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.csproj", "{29E42ADB-85F8-44AE-A9B0-078F84C1B866}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo", "test\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.csproj", "{0C498CF2-D052-4BF7-AD35-509A90F69707}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Http.Client.IdentityModel.Web.Tests", "test\Volo.Abp.Http.Client.IdentityModel.Web.Tests\Volo.Abp.Http.Client.IdentityModel.Web.Tests.csproj", "{E1963439-2BE5-4DB5-8438-2A9A792A1ADA}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -779,6 +789,22 @@ Global {9CAA07ED-FE5C-4427-A6FA-6C6CB5B4CC62}.Debug|Any CPU.Build.0 = Debug|Any CPU {9CAA07ED-FE5C-4427-A6FA-6C6CB5B4CC62}.Release|Any CPU.ActiveCfg = Release|Any CPU {9CAA07ED-FE5C-4427-A6FA-6C6CB5B4CC62}.Release|Any CPU.Build.0 = Release|Any CPU + {925AF101-2203-409C-9C3B-03917316858F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {925AF101-2203-409C-9C3B-03917316858F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {925AF101-2203-409C-9C3B-03917316858F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {925AF101-2203-409C-9C3B-03917316858F}.Release|Any CPU.Build.0 = Release|Any CPU + {2307198B-5837-4F05-AA84-D6EC2A923D69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2307198B-5837-4F05-AA84-D6EC2A923D69}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2307198B-5837-4F05-AA84-D6EC2A923D69}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2307198B-5837-4F05-AA84-D6EC2A923D69}.Release|Any CPU.Build.0 = Release|Any CPU + {9467418B-4A9B-4093-9B31-01A9DEF5B372}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9467418B-4A9B-4093-9B31-01A9DEF5B372}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9467418B-4A9B-4093-9B31-01A9DEF5B372}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9467418B-4A9B-4093-9B31-01A9DEF5B372}.Release|Any CPU.Build.0 = Release|Any CPU + {CD5770BB-2E0C-4B3C-80E0-21B8CC43DBA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CD5770BB-2E0C-4B3C-80E0-21B8CC43DBA9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CD5770BB-2E0C-4B3C-80E0-21B8CC43DBA9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CD5770BB-2E0C-4B3C-80E0-21B8CC43DBA9}.Release|Any CPU.Build.0 = Release|Any CPU {29E42ADB-85F8-44AE-A9B0-078F84C1B866}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {29E42ADB-85F8-44AE-A9B0-078F84C1B866}.Debug|Any CPU.Build.0 = Debug|Any CPU {29E42ADB-85F8-44AE-A9B0-078F84C1B866}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -787,6 +813,10 @@ Global {0C498CF2-D052-4BF7-AD35-509A90F69707}.Debug|Any CPU.Build.0 = Debug|Any CPU {0C498CF2-D052-4BF7-AD35-509A90F69707}.Release|Any CPU.ActiveCfg = Release|Any CPU {0C498CF2-D052-4BF7-AD35-509A90F69707}.Release|Any CPU.Build.0 = Release|Any CPU + {E1963439-2BE5-4DB5-8438-2A9A792A1ADA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E1963439-2BE5-4DB5-8438-2A9A792A1ADA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E1963439-2BE5-4DB5-8438-2A9A792A1ADA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E1963439-2BE5-4DB5-8438-2A9A792A1ADA}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -919,8 +949,13 @@ Global {E69182B3-350A-43F5-A935-5EBBEBECEF97} = {447C8A77-E5F0-4538-8687-7383196D04EA} {3B801003-BE74-49ED-9749-DA5E99F45EBF} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} {9CAA07ED-FE5C-4427-A6FA-6C6CB5B4CC62} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {925AF101-2203-409C-9C3B-03917316858F} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {2307198B-5837-4F05-AA84-D6EC2A923D69} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {9467418B-4A9B-4093-9B31-01A9DEF5B372} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {CD5770BB-2E0C-4B3C-80E0-21B8CC43DBA9} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} {29E42ADB-85F8-44AE-A9B0-078F84C1B866} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} {0C498CF2-D052-4BF7-AD35-509A90F69707} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {E1963439-2BE5-4DB5-8438-2A9A792A1ADA} = {447C8A77-E5F0-4538-8687-7383196D04EA} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {BB97ECF4-9A84-433F-A80B-2A3285BDD1D5} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpDynamicformTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpDynamicformTagHelperService.cs index ee2a920980..6f8ccf285a 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpDynamicformTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpDynamicformTagHelperService.cs @@ -47,7 +47,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form SetFormAttributes(context, output); - SetSubmitButton(context, output); + await SetSubmitButton(context, output); } protected virtual async Task ConvertToMvcForm(TagHelperContext context, TagHelperOutput output) @@ -107,14 +107,14 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form output.Content.SetHtmlContent(childContent); } - protected virtual void SetSubmitButton(TagHelperContext context, TagHelperOutput output) + protected virtual async Task SetSubmitButton(TagHelperContext context, TagHelperOutput output) { if (!TagHelper.SubmitButton ?? true) { return; } - var buttonHtml = ProcessSubmitButtonAndGetContentAsync(context, output); + var buttonHtml = await ProcessSubmitButtonAndGetContentAsync(context, output); output.PostContent.SetHtmlContent(output.PostContent.GetContent() + buttonHtml); } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/AlertsDemo/AlertsDemoViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/AlertsDemo/AlertsDemoViewComponent.cs new file mode 100644 index 0000000000..2599c317cf --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/AlertsDemo/AlertsDemoViewComponent.cs @@ -0,0 +1,16 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Widgets; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.AlertsDemo +{ + [Widget] + public class AlertsDemoViewComponent : AbpViewComponent + { + public const string ViewPath = "/Views/Components/Themes/Shared/Demos/AlertsDemo/Default.cshtml"; + + public IViewComponentResult Invoke() + { + return View(ViewPath); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/AlertsDemo/Default.cshtml b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/AlertsDemo/Default.cshtml new file mode 100644 index 0000000000..8c132b9197 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/AlertsDemo/Default.cshtml @@ -0,0 +1,70 @@ +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.AlertsDemo + + + + A simple primary alert—check it out! + + + A simple secondary alert—check it out! + + + A simple success alert—check it out! + + + A simple danger alert—check it out! + + + A simple warning alert—check it out! + + + A simple info alert—check it out! + + + A simple light alert—check it out! + + + A simple dark alert—check it out! + + + + + + A simple primary alert with an example link. Give it a click if you like. + + + A simple secondary alert with an example link. Give it a click if you like. + + + A simple success alert with an example link. Give it a click if you like. + + + A simple danger alert with an example link. Give it a click if you like. + + + A simple warning alert with an example link. Give it a click if you like. + + + A simple info alert with an example link. Give it a click if you like. + + + A simple light alert with an example link. Give it a click if you like. + + + A simple dark alert with an example link. Give it a click if you like. + + + + + +

Well done!

+

Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.

+
+

Whenever you need to, be sure to use margin utilities to keep things nice and tidy.

+
+
+ + + + Holy guacamole! You should check in on some of those fields below. + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/BadgesDemo/BadgesDemoViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/BadgesDemo/BadgesDemoViewComponent.cs new file mode 100644 index 0000000000..bdc47336cd --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/BadgesDemo/BadgesDemoViewComponent.cs @@ -0,0 +1,16 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Widgets; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.BadgesDemo +{ + [Widget] + public class BadgesDemoViewComponent : AbpViewComponent + { + public const string ViewPath = "/Views/Components/Themes/Shared/Demos/BadgesDemo/Default.cshtml"; + + public IViewComponentResult Invoke() + { + return View(ViewPath); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/BadgesDemo/Default.cshtml b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/BadgesDemo/Default.cshtml new file mode 100644 index 0000000000..9ed21ebe3e --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/BadgesDemo/Default.cshtml @@ -0,0 +1,49 @@ +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.BadgesDemo + + +

Example heading New

+

Example heading New

+

Example heading New

+

Example heading New

+
Example heading New
+
Example heading New
+
+ + + + Notifications 4 + + + + + Primary + Secondary + Success + Danger + Warning + Info + Light + Dark + + + + Primary + Secondary + Success + Danger + Warning + Info + Light + Dark + + + + Primary + Secondary + Success + Danger + Warning + Info + Light + Dark + \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/BordersDemo/BordersDemoViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/BordersDemo/BordersDemoViewComponent.cs new file mode 100644 index 0000000000..2ba33feb54 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/BordersDemo/BordersDemoViewComponent.cs @@ -0,0 +1,16 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Widgets; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.BordersDemo +{ + [Widget] + public class BordersDemoViewComponent : AbpViewComponent + { + public const string ViewPath = "/Views/Components/Themes/Shared/Demos/BordersDemo/Default.cshtml"; + + public IViewComponentResult Invoke() + { + return View(ViewPath); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/BordersDemo/Default.cshtml b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/BordersDemo/Default.cshtml new file mode 100644 index 0000000000..281f6c73ed --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/BordersDemo/Default.cshtml @@ -0,0 +1,46 @@ +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.BordersDemo + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/BreadcrumbsDemo/BreadcrumbsDemoViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/BreadcrumbsDemo/BreadcrumbsDemoViewComponent.cs new file mode 100644 index 0000000000..e700acb667 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/BreadcrumbsDemo/BreadcrumbsDemoViewComponent.cs @@ -0,0 +1,16 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Widgets; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.BreadcrumbsDemo +{ + [Widget] + public class BreadcrumbsDemoViewComponent : AbpViewComponent + { + public const string ViewPath = "/Views/Components/Themes/Shared/Demos/BreadcrumbsDemo/Default.cshtml"; + + public IViewComponentResult Invoke() + { + return View(ViewPath); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/BreadcrumbsDemo/Default.cshtml b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/BreadcrumbsDemo/Default.cshtml new file mode 100644 index 0000000000..8338bdfc1f --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/BreadcrumbsDemo/Default.cshtml @@ -0,0 +1,18 @@ +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.BreadcrumbsDemo + + + + + + + + + + + + + + + + + diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/ButtonGroupsDemo/ButtonGroupsDemoViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/ButtonGroupsDemo/ButtonGroupsDemoViewComponent.cs new file mode 100644 index 0000000000..ff5b917d40 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/ButtonGroupsDemo/ButtonGroupsDemoViewComponent.cs @@ -0,0 +1,16 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Widgets; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.ButtonGroupsDemo +{ + [Widget] + public class ButtonGroupsDemoViewComponent : AbpViewComponent + { + public const string ViewPath = "/Views/Components/Themes/Shared/Demos/ButtonGroupsDemo/Default.cshtml"; + + public IViewComponentResult Invoke() + { + return View(ViewPath); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/ButtonGroupsDemo/Default.cshtml b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/ButtonGroupsDemo/Default.cshtml new file mode 100644 index 0000000000..3039e1b1da --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/ButtonGroupsDemo/Default.cshtml @@ -0,0 +1,68 @@ +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.ButtonGroupsDemo + + + + Left + Middle + Right + + + + + + + 1 + 2 + 3 + 4 + + + 5 + 6 + 7 + + + 8 + + + + + + + Left + Middle + Right + + + Left + Middle + Right + + + Left + Middle + Right + + + + + + 1 + 2 + + + + Dropdown link + Dropdown link + + + + + + + + Left + Middle + Right + + diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/CardsDemo/CardsDemoViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/CardsDemo/CardsDemoViewComponent.cs new file mode 100644 index 0000000000..f192285f80 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/CardsDemo/CardsDemoViewComponent.cs @@ -0,0 +1,16 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Widgets; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.CardsDemo +{ + [Widget] + public class CardsDemoViewComponent : AbpViewComponent + { + public const string ViewPath = "/Views/Components/Themes/Shared/Demos/CardsDemo/Default.cshtml"; + + public IViewComponentResult Invoke() + { + return View(ViewPath); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/CardsDemo/Default.cshtml b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/CardsDemo/Default.cshtml new file mode 100644 index 0000000000..b37c877f34 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/CardsDemo/Default.cshtml @@ -0,0 +1,156 @@ +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.CardsDemo + + + + + + Card Title + Some quick example text to build on the card title and make up the bulk of the card's content. + Go somewhere + + + + + + + + Card title + Card subtitle + Some quick example text to build on the card title and make up the bulk of the card's content. + Card link + Another link + + + + + + + + Cras justo odio + Dapibus ac facilisis in + Vestibulum at eros + + + + + + + Featured + + Cras justo odio + Dapibus ac facilisis in + Vestibulum at eros + + + + + + + + + Card TitleSome quick example text to build on the card title and make up the bulk of the card's content. + + + Cras justo odio + Dapibus ac facilisis in + Vestibulum at eros + + + Card link + Another link + + + + + + + Featured + + Special title treatment + With supporting text below as a natural lead-in to additional content. + Go somewhere + + + + + + + Quote + + +

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

+
Someone famous in Source Title
+
+
+
+
+ + + + Featured + + Special title treatment + With supporting text below as a natural lead-in to additional content. + Go somewhere + + 2 days ago + + + + + + Featured + + Special title treatment + With supporting text below as a natural lead-in to additional content. + + + + + Featured + + Special title treatment + With supporting text below as a natural lead-in to additional content. + + + + + Featured + + Special title treatment + With supporting text below as a natural lead-in to additional content. + + + + + Featured + + Special title treatment + With supporting text below as a natural lead-in to additional content. + + + + + Featured + + Special title treatment + With supporting text below as a natural lead-in to additional content. + + + + + Featured + + Special title treatment + With supporting text below as a natural lead-in to additional content. + + + + + Featured + + Special title treatment + With supporting text below as a natural lead-in to additional content. + + + diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/CollapseDemo/CollapseDemoViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/CollapseDemo/CollapseDemoViewComponent.cs new file mode 100644 index 0000000000..28ccbcb447 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/CollapseDemo/CollapseDemoViewComponent.cs @@ -0,0 +1,16 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Widgets; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.CollapseDemo +{ + [Widget] + public class CollapseDemoViewComponent : AbpViewComponent + { + public const string ViewPath = "/Views/Components/Themes/Shared/Demos/CollapseDemo/Default.cshtml"; + + public IViewComponentResult Invoke() + { + return View(ViewPath); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/CollapseDemo/Default.cshtml b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/CollapseDemo/Default.cshtml new file mode 100644 index 0000000000..6455bef2fc --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/CollapseDemo/Default.cshtml @@ -0,0 +1,43 @@ +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.CollapseDemo + + + + Link with href + + + Anim pariatur wolf moon tempor,,, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. + + + + + Toggle first element + + + + + + + Curabitur porta porttitor libero eu luctus. Praesent ultrices mattis commodo. Integer sodales massa risus, in molestie enim sagittis blandit + + + + + Anim pariatur wolf moon tempor,,, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. + + + + + + + + + Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry rtat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. + + + Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. + + + Anim pariatur wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. + + + diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/DropdownsDemo/Default.cshtml b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/DropdownsDemo/Default.cshtml new file mode 100644 index 0000000000..26a0c63e3c --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/DropdownsDemo/Default.cshtml @@ -0,0 +1,171 @@ +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.DropdownsDemo + + + + + + Action + Another action + Something else here + + + + + + + + + Action + Another action + Something else here + + + + + + + + + Action + Another action + Something else here + + Separated link + + + + + + + + + Action + Another action + Something else here + + Separated link + + + + + + + + + Action + Another action + Something else here + + Separated link + + + + + Action + Another action + Something else here + + Separated link + + + + + Action + Another action + Something else here + + Separated link + + + + + Action + Another action + Something else here + + Separated link + + + + + + + + + Action + Another action + Something else here + + + + + Action + Another action + Something else here + + + + + Action + Another action + Something else here + + + + + + + + + Dropdown Header + Action + Active action + Disabled action + + Dropdown Item Text + Something else here + + + + + + + + + Action + Active action + Disabled action + + + + + + + + +

+ Some example text that's free-flowing within the dropdown menu. +

+

+ And this is more example text. +

+
+
+
+ + + + + +
+ + + + + + + New around here? Sign up + Forgot password? +
+
+
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/DropdownsDemo/DropdownsDemoViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/DropdownsDemo/DropdownsDemoViewComponent.cs new file mode 100644 index 0000000000..2aa67f8616 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/DropdownsDemo/DropdownsDemoViewComponent.cs @@ -0,0 +1,16 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Widgets; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.DropdownsDemo +{ + [Widget] + public class DropdownsDemoViewComponent : AbpViewComponent + { + public const string ViewPath = "/Views/Components/Themes/Shared/Demos/DropdownsDemo/Default.cshtml"; + + public IViewComponentResult Invoke() + { + return View(ViewPath); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/GridsDemo/Default.cshtml b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/GridsDemo/Default.cshtml new file mode 100644 index 0000000000..ee043b71e1 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/GridsDemo/Default.cshtml @@ -0,0 +1,223 @@ +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.GridsDemo + + + + + 1 of 2 + 2 of 2 + + + 1 of 3 + 2 of 3 + 3 of 3 + + + + + + + + column + column + + column + column + + + + + + + + 1 of 3 + 2 of 3 (wider) + 3 of 3 + + + 1 of 3 + 2 of 3 (wider) + 3 of 3 + + + + + + + + 1 of 3 + Variable width content + 3 of 3 + + + 1 of 3 + Variable width content + 3 of 3 + + + + + + + col + col + col + col + + + col-8 + col-4 + + + + + + col-sm-8 + col-sm-4 + + + col-sm + col-sm + col-sm + col-sm + + + + + + + .col-12 .col-md-8 + .col-6 .col-md-4 + + + + + .col-6 .col-md-4 + .col-6 .col-md-4 + .col-6 .col-md-4 + + + + + .col-6 + .col-6 + + + + + + + column + column + column + + + column + column + column + + + column + column + column + + + + + + + + column + column + column + + + + + + + + One of two columns + One of two columns + + + One of two columns + One of two columns + + + One of two columns + One of two columns + + + One of two columns + One of two columns + + + One of two columns + One of two columns + + + + + + + One of two columns + One of two columns + + + + + + .col-9 + .col-4
Since 9 + 4 = 13 > 12, this 4-column-wide div gets wrapped onto a new line as one contiguous unit.
+ .col-6
Subsequent columns continue along the new line.s
+
+
+ + + + + First, but Last + Second, but unordered + Third, but Second + + + + + + + + First, but Last + Second, but unordered + Third, but First + + + + + + + + .col-md-4 + .col-md-4 .offset-md-4 + + + .col-md-3 .offset-md-3 + .col-md-3 .offset-md-3 + + + .col-md-6 .offset-md-3 + + + + + + + + .col-sm-5 .col-md-6 + .col-sm-5 .offset-sm-2 .col-md-6 .offset-md-0 + + + col-sm-6 .col-md-5 .col-lg-6 + .col-sm-6 .col-md-5 .offset-md-2 .col-lg-6 .offset-lg-0 + + + diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/GridsDemo/GridsDemoViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/GridsDemo/GridsDemoViewComponent.cs new file mode 100644 index 0000000000..99f99186cd --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/GridsDemo/GridsDemoViewComponent.cs @@ -0,0 +1,16 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Widgets; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.GridsDemo +{ + [Widget] + public class GridsDemoViewComponent : AbpViewComponent + { + public const string ViewPath = "/Views/Components/Themes/Shared/Demos/GridsDemo/Default.cshtml"; + + public IViewComponentResult Invoke() + { + return View(ViewPath); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/ListGroupsDemo/Default.cshtml b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/ListGroupsDemo/Default.cshtml new file mode 100644 index 0000000000..ff11769976 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/ListGroupsDemo/Default.cshtml @@ -0,0 +1,82 @@ +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.ListGroupsDemo + + + + Cras justo odio + Dapibus ac facilisis in + Morbi leo risus + Vestibulum at eros + + + + + + Cras justo odio + Dapibus ac facilisis in + Morbi leo risus + Vestibulum at eros + + + + + + Cras justo odio + Dapibus ac facilisis in + Morbi leo risus + Vestibulum at eros + + + + + + Cras justo odio + Dapibus ac facilisis in + Morbi leo risus + Vestibulum at eros + + + + + + Cras justo odio + Dapibus ac facilisis in + Morbi leo risus + Vestibulum at eros + + + + + + Cras justo odio + A simple Primary list group item + A simple Secondary list group item + A simple Success list group item + A simple Danger list group item + A simple Warning list group item + A simple Info list group item + A simple Light list group item + A simple Dark list group item + + + + + + Cras justo odio + A simple Primary list group item + A simple Secondary list group item + A simple Success list group item + A simple Danger list group item + A simple Warning list group item + A simple Info list group item + A simple Light list group item + A simple Dark list group item + + + + + + Cras justo odio 14 + Dapibus ac facilisis in 2 + Morbi leo risus 1 + + diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/ListGroupsDemo/ListGroupsDemoViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/ListGroupsDemo/ListGroupsDemoViewComponent.cs new file mode 100644 index 0000000000..9e0f89e325 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/ListGroupsDemo/ListGroupsDemoViewComponent.cs @@ -0,0 +1,16 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Widgets; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.ListGroupsDemo +{ + [Widget] + public class ListGroupsDemoViewComponent : AbpViewComponent + { + public const string ViewPath = "/Views/Components/Themes/Shared/Demos/ListGroupsDemo/Default.cshtml"; + + public IViewComponentResult Invoke() + { + return View(ViewPath); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/ModalsDemo/Default.cshtml b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/ModalsDemo/Default.cshtml new file mode 100644 index 0000000000..91ed5b8bff --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/ModalsDemo/Default.cshtml @@ -0,0 +1,15 @@ +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.ModalsDemo +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal + + + + Launch modal + + + + + Woohoo, you're reading this text in a modal! + + + + diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/ModalsDemo/ModalsDemoViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/ModalsDemo/ModalsDemoViewComponent.cs new file mode 100644 index 0000000000..272ea4a480 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/ModalsDemo/ModalsDemoViewComponent.cs @@ -0,0 +1,16 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Widgets; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.ModalsDemo +{ + [Widget] + public class ModalsDemoViewComponent : AbpViewComponent + { + public const string ViewPath = "/Views/Components/Themes/Shared/Demos/ModalsDemo/Default.cshtml"; + + public IViewComponentResult Invoke() + { + return View(ViewPath); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/NavsDemo/Default.cshtml b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/NavsDemo/Default.cshtml new file mode 100644 index 0000000000..033fefa45b --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/NavsDemo/Default.cshtml @@ -0,0 +1,53 @@ +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.NavsDemo + + + + + Active + + + Longer nav link + + + link + + + disabled + + + + + + + Navbar + + + + Home (current) + + + Link + + + + + + Dropdown header + Action + Another disabled action + Something else here + + Separated link + + + + + Disabled + + + + Sample Text + + + + diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/NavsDemo/NavsDemoViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/NavsDemo/NavsDemoViewComponent.cs new file mode 100644 index 0000000000..5bc0363193 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/NavsDemo/NavsDemoViewComponent.cs @@ -0,0 +1,16 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Widgets; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.NavsDemo +{ + [Widget] + public class NavsDemoViewComponent : AbpViewComponent + { + public const string ViewPath = "/Views/Components/Themes/Shared/Demos/NavsDemo/Default.cshtml"; + + public IViewComponentResult Invoke() + { + return View(ViewPath); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/PopoversDemo/Default.cshtml b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/PopoversDemo/Default.cshtml new file mode 100644 index 0000000000..8e171cb640 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/PopoversDemo/Default.cshtml @@ -0,0 +1,16 @@ +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.PopoversDemo + + + + Popover Default + + + Popover With Title + + + Dismissible Popover + + + Disabled Popover + + diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/PopoversDemo/PopoversDemoViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/PopoversDemo/PopoversDemoViewComponent.cs new file mode 100644 index 0000000000..6114918165 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/PopoversDemo/PopoversDemoViewComponent.cs @@ -0,0 +1,16 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Widgets; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.PopoversDemo +{ + [Widget] + public class PopoversDemoViewComponent : AbpViewComponent + { + public const string ViewPath = "/Views/Components/Themes/Shared/Demos/PopoversDemo/Default.cshtml"; + + public IViewComponentResult Invoke() + { + return View(ViewPath); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/ProgressBarsDemo/Default.cshtml b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/ProgressBarsDemo/Default.cshtml new file mode 100644 index 0000000000..00f917b28a --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/ProgressBarsDemo/Default.cshtml @@ -0,0 +1,17 @@ +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.ProgressBarsDemo + + + + + %25 + + + + %50 + + + + %10 + + + diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/ProgressBarsDemo/ProgressBarsDemoViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/ProgressBarsDemo/ProgressBarsDemoViewComponent.cs new file mode 100644 index 0000000000..acaf9b4135 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/ProgressBarsDemo/ProgressBarsDemoViewComponent.cs @@ -0,0 +1,16 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Widgets; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.ProgressBarsDemo +{ + [Widget] + public class ProgressBarsDemoViewComponent : AbpViewComponent + { + public const string ViewPath = "/Views/Components/Themes/Shared/Demos/ProgressBarsDemo/Default.cshtml"; + + public IViewComponentResult Invoke() + { + return View(ViewPath); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/TablesDemo/Default.cshtml b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/TablesDemo/Default.cshtml new file mode 100644 index 0000000000..d1ddbf16df --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/TablesDemo/Default.cshtml @@ -0,0 +1,134 @@ +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.TablesDemo + + + + + + # + First + Last + Handle + + + + + 1 + Mark + Otto + mdo + + + 2 + Jacob + Thornton + fat + + + 3 + Larry + the Bird + twitter + + + + + + + + + + # + First + Last + Handle + + + + + 1 + Mark + Otto + mdo + + + 2 + Jacob + Thornton + fat + + + 3 + Larry + the Bird + twitter + + + + + + + + List of users + + + # + First + Last + Handle + + + + + 1 + Mark + Otto + mdo + + + 2 + Jacob + Thornton + fat + + + 3 + Larry + the Bird + twitter + + + + + + + + + + # + First + Last + Handle + + + + + 1 + Mark + Otto + mdo + + + 2 + Jacob + Thornton + fat + + + 3 + Larry + the Bird + twitter + + + + diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/TablesDemo/TablesDemoViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/TablesDemo/TablesDemoViewComponent.cs new file mode 100644 index 0000000000..e40ecae321 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/TablesDemo/TablesDemoViewComponent.cs @@ -0,0 +1,16 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Widgets; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.TablesDemo +{ + [Widget] + public class TablesDemoViewComponent : AbpViewComponent + { + public const string ViewPath = "/Views/Components/Themes/Shared/Demos/TablesDemo/Default.cshtml"; + + public IViewComponentResult Invoke() + { + return View(ViewPath); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/TabsDemo/Default.cshtml b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/TabsDemo/Default.cshtml new file mode 100644 index 0000000000..e91c67d02c --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/TabsDemo/Default.cshtml @@ -0,0 +1,63 @@ +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.TabsDemo + + + + + Content_Home + + + + Content_Profile + + + + Content_1_Content + + + Content_2_Content + + + + + + + + + Content_Home + + + Content_Profile + + + Content_Contact + + + + + + + + Content_Home + + + Content_Profile + + + Content_Contact + + + + + + + + Content_Home + + + Content_Profile + + + Content_Contact + + + diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/TabsDemo/TabsDemoViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/TabsDemo/TabsDemoViewComponent.cs new file mode 100644 index 0000000000..00f3b5c2c4 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/TabsDemo/TabsDemoViewComponent.cs @@ -0,0 +1,16 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Widgets; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.TabsDemo +{ + [Widget] + public class TabsDemoViewComponent : AbpViewComponent + { + public const string ViewPath = "/Views/Components/Themes/Shared/Demos/TabsDemo/Default.cshtml"; + + public IViewComponentResult Invoke() + { + return View(ViewPath); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/TooltipsDemo/Default.cshtml b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/TooltipsDemo/Default.cshtml new file mode 100644 index 0000000000..b611237b29 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/TooltipsDemo/Default.cshtml @@ -0,0 +1,23 @@ +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.TooltipsDemo + + + + Tooltip Default + + + + Tooltip on top + + + + Tooltip on right + + + + Tooltip on bottom + + + + Disabled button Tooltip + + diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/TooltipsDemo/TooltipsDemoViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/TooltipsDemo/TooltipsDemoViewComponent.cs new file mode 100644 index 0000000000..a23fede627 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo/Views/Components/Themes/Shared/Demos/TooltipsDemo/TooltipsDemoViewComponent.cs @@ -0,0 +1,16 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Widgets; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.TooltipsDemo +{ + [Widget] + public class TooltipsDemoViewComponent : AbpViewComponent + { + public const string ViewPath = "/Views/Components/Themes/Shared/Demos/TooltipsDemo/Default.cshtml"; + + public IViewComponentResult Invoke() + { + return View(ViewPath); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Auditing/AbpAuditActionFilter.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Auditing/AbpAuditActionFilter.cs index 33932137cb..0ee62f9b65 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Auditing/AbpAuditActionFilter.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Auditing/AbpAuditActionFilter.cs @@ -84,12 +84,6 @@ namespace Volo.Abp.AspNetCore.Mvc.Auditing return false; } - //TODO: This is partially duplication of AuditHelper.ShouldSaveAudit method. Check why it does not work for controllers - if (!AuditingInterceptorRegistrar.ShouldAuditTypeByDefault(context.Controller.GetType())) - { - return false; - } - auditLog = auditLogScope.Log; auditLogAction = _auditingHelper.CreateAuditLogAction( auditLog, diff --git a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AbpAuditingMiddleware.cs b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AbpAuditingMiddleware.cs index f59c5b6b3a..d3f261a3f7 100644 --- a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AbpAuditingMiddleware.cs +++ b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AbpAuditingMiddleware.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingManager.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingManager.cs index 2a9dd8bf5a..8cc9fb7675 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingManager.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingManager.cs @@ -114,20 +114,7 @@ namespace Volo.Abp.Auditing { BeforeSave(saveHandle); - if (ShouldSave(saveHandle.AuditLog)) - { - await _auditingStore.SaveAsync(saveHandle.AuditLog); - } - } - - protected bool ShouldSave(AuditLogInfo auditLog) - { - if (!auditLog.Actions.Any() && !auditLog.EntityChanges.Any()) - { - return false; - } - - return true; + await _auditingStore.SaveAsync(saveHandle.AuditLog); } protected class DisposableSaveHandle : IAuditLogSaveHandle diff --git a/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.HangFire/FodyWeavers.xml b/framework/src/Volo.Abp.BackgroundJobs.Quartz/FodyWeavers.xml similarity index 100% rename from modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.HangFire/FodyWeavers.xml rename to framework/src/Volo.Abp.BackgroundJobs.Quartz/FodyWeavers.xml diff --git a/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.HangFire/FodyWeavers.xsd b/framework/src/Volo.Abp.BackgroundJobs.Quartz/FodyWeavers.xsd similarity index 100% rename from modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.HangFire/FodyWeavers.xsd rename to framework/src/Volo.Abp.BackgroundJobs.Quartz/FodyWeavers.xsd diff --git a/framework/src/Volo.Abp.BackgroundJobs.Quartz/Volo.Abp.BackgroundJobs.Quartz.csproj b/framework/src/Volo.Abp.BackgroundJobs.Quartz/Volo.Abp.BackgroundJobs.Quartz.csproj new file mode 100644 index 0000000000..67c07f77d6 --- /dev/null +++ b/framework/src/Volo.Abp.BackgroundJobs.Quartz/Volo.Abp.BackgroundJobs.Quartz.csproj @@ -0,0 +1,22 @@ + + + + + + + netstandard2.0 + Volo.Abp.BackgroundJobs.Quartz + Volo.Abp.BackgroundJobs.Quartz + $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; + false + false + false + + + + + + + + + diff --git a/framework/src/Volo.Abp.BackgroundJobs.Quartz/Volo/Abp/BackgroundJobs/Quartz/AbpBackgroundJobsQuartzModule.cs b/framework/src/Volo.Abp.BackgroundJobs.Quartz/Volo/Abp/BackgroundJobs/Quartz/AbpBackgroundJobsQuartzModule.cs new file mode 100644 index 0000000000..d5f84ed91e --- /dev/null +++ b/framework/src/Volo.Abp.BackgroundJobs.Quartz/Volo/Abp/BackgroundJobs/Quartz/AbpBackgroundJobsQuartzModule.cs @@ -0,0 +1,18 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Modularity; +using Volo.Abp.Quartz; + +namespace Volo.Abp.BackgroundJobs.Quartz +{ + [DependsOn( + typeof(AbpBackgroundJobsAbstractionsModule), + typeof(AbpQuartzModule) + )] + public class AbpBackgroundJobsQuartzModule :AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddTransient(typeof(QuartzJobExecutionAdapter<>)); + } + } +} diff --git a/framework/src/Volo.Abp.BackgroundJobs.Quartz/Volo/Abp/BackgroundJobs/Quartz/QuartzBackgroundJobManager.cs b/framework/src/Volo.Abp.BackgroundJobs.Quartz/Volo/Abp/BackgroundJobs/Quartz/QuartzBackgroundJobManager.cs new file mode 100644 index 0000000000..2e7b8193b4 --- /dev/null +++ b/framework/src/Volo.Abp.BackgroundJobs.Quartz/Volo/Abp/BackgroundJobs/Quartz/QuartzBackgroundJobManager.cs @@ -0,0 +1,27 @@ +using System; +using System.Threading.Tasks; +using Quartz; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.BackgroundJobs.Quartz +{ + [Dependency(ReplaceServices = true)] + public class QuartzBackgroundJobManager : IBackgroundJobManager, ITransientDependency + { + private readonly IScheduler _scheduler; + + public QuartzBackgroundJobManager(IScheduler scheduler) + { + _scheduler = scheduler; + } + + public async Task EnqueueAsync(TArgs args, BackgroundJobPriority priority = BackgroundJobPriority.Normal, + TimeSpan? delay = null) + { + var jobDetail = JobBuilder.Create>().SetJobData(new JobDataMap { { nameof(TArgs), args } }).Build(); + var trigger = !delay.HasValue ? TriggerBuilder.Create().StartNow().Build() : TriggerBuilder.Create().StartAt(new DateTimeOffset(DateTime.Now.Add(delay.Value))).Build(); + await _scheduler.ScheduleJob(jobDetail, trigger); + return jobDetail.Key.ToString(); + } + } +} diff --git a/framework/src/Volo.Abp.BackgroundJobs.Quartz/Volo/Abp/BackgroundJobs/Quartz/QuartzJobExecutionAdapter.cs b/framework/src/Volo.Abp.BackgroundJobs.Quartz/Volo/Abp/BackgroundJobs/Quartz/QuartzJobExecutionAdapter.cs new file mode 100644 index 0000000000..85a1ef736f --- /dev/null +++ b/framework/src/Volo.Abp.BackgroundJobs.Quartz/Volo/Abp/BackgroundJobs/Quartz/QuartzJobExecutionAdapter.cs @@ -0,0 +1,36 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using Quartz; + +namespace Volo.Abp.BackgroundJobs.Quartz +{ + public class QuartzJobExecutionAdapter : IJob + { + protected AbpBackgroundJobOptions Options { get; } + protected IServiceScopeFactory ServiceScopeFactory { get; } + protected IBackgroundJobExecuter JobExecuter { get; } + + public QuartzJobExecutionAdapter( + IOptions options, + IBackgroundJobExecuter jobExecuter, + IServiceScopeFactory serviceScopeFactory) + { + JobExecuter = jobExecuter; + ServiceScopeFactory = serviceScopeFactory; + Options = options.Value; + } + + public async Task Execute(IJobExecutionContext context) + { + using (var scope = ServiceScopeFactory.CreateScope()) + { + var args = (TArgs)context.JobDetail.JobDataMap.Get(nameof(TArgs)); + var jobType = Options.GetJob(typeof(TArgs)).JobType; + var jobContext = new JobExecutionContext(scope.ServiceProvider, jobType, args); + await JobExecuter.ExecuteAsync(jobContext); + } + } + } +} diff --git a/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.RabbitMq/FodyWeavers.xml b/framework/src/Volo.Abp.BackgroundWorkers.Quartz/FodyWeavers.xml similarity index 100% rename from modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.RabbitMq/FodyWeavers.xml rename to framework/src/Volo.Abp.BackgroundWorkers.Quartz/FodyWeavers.xml diff --git a/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.RabbitMq/FodyWeavers.xsd b/framework/src/Volo.Abp.BackgroundWorkers.Quartz/FodyWeavers.xsd similarity index 100% rename from modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.RabbitMq/FodyWeavers.xsd rename to framework/src/Volo.Abp.BackgroundWorkers.Quartz/FodyWeavers.xsd diff --git a/framework/src/Volo.Abp.BackgroundWorkers.Quartz/Volo.Abp.BackgroundWorkers.Quartz.csproj b/framework/src/Volo.Abp.BackgroundWorkers.Quartz/Volo.Abp.BackgroundWorkers.Quartz.csproj new file mode 100644 index 0000000000..1a3ca4e254 --- /dev/null +++ b/framework/src/Volo.Abp.BackgroundWorkers.Quartz/Volo.Abp.BackgroundWorkers.Quartz.csproj @@ -0,0 +1,24 @@ + + + + + + + + netstandard2.0 + Volo.Abp.BackgroundWorkers.Quartz + Volo.Abp.BackgroundWorkers.Quartz + $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; + false + false + false + + + + + + + + + + diff --git a/framework/src/Volo.Abp.BackgroundWorkers.Quartz/Volo/Abp/BackgroundWorkers/Quartz/AbpBackgroundWorkersQuartzModule.cs b/framework/src/Volo.Abp.BackgroundWorkers.Quartz/Volo/Abp/BackgroundWorkers/Quartz/AbpBackgroundWorkersQuartzModule.cs new file mode 100644 index 0000000000..1f23b350aa --- /dev/null +++ b/framework/src/Volo.Abp.BackgroundWorkers.Quartz/Volo/Abp/BackgroundWorkers/Quartz/AbpBackgroundWorkersQuartzModule.cs @@ -0,0 +1,30 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection.Extensions; +using Volo.Abp.Modularity; +using Volo.Abp.Quartz; + +namespace Volo.Abp.BackgroundWorkers.Quartz +{ + [DependsOn( + typeof(AbpBackgroundWorkersModule), + typeof(AbpQuartzModule) + )] + public class AbpBackgroundWorkersQuartzModule : AbpModule + { + public override void PreConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddConventionalRegistrar(new AbpQuartzConventionalRegistrar()); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + var backgroundWorkerManager = context.ServiceProvider.GetService(); + var works = context.ServiceProvider.GetServices(); + + foreach (var work in works) + { + backgroundWorkerManager.Add(work); + } + } + } +} diff --git a/framework/src/Volo.Abp.BackgroundWorkers.Quartz/Volo/Abp/BackgroundWorkers/Quartz/AbpQuartzConventionalRegistrar.cs b/framework/src/Volo.Abp.BackgroundWorkers.Quartz/Volo/Abp/BackgroundWorkers/Quartz/AbpQuartzConventionalRegistrar.cs new file mode 100644 index 0000000000..8d709c449c --- /dev/null +++ b/framework/src/Volo.Abp.BackgroundWorkers.Quartz/Volo/Abp/BackgroundWorkers/Quartz/AbpQuartzConventionalRegistrar.cs @@ -0,0 +1,27 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.BackgroundWorkers.Quartz +{ + public class AbpQuartzConventionalRegistrar : DefaultConventionalRegistrar + { + public override void AddType(IServiceCollection services, Type type) + { + if (!typeof(IQuartzBackgroundWorker).IsAssignableFrom(type)) + { + return; + } + + var dependencyAttribute = GetDependencyAttributeOrNull(type); + var lifeTime = GetLifeTimeOrNull(type, dependencyAttribute); + + if (lifeTime == null) + { + return; + } + + services.Add(ServiceDescriptor.Describe(typeof(IQuartzBackgroundWorker), type, lifeTime.Value)); + } + } +} diff --git a/framework/src/Volo.Abp.BackgroundWorkers.Quartz/Volo/Abp/BackgroundWorkers/Quartz/IQuartzBackgroundWorker.cs b/framework/src/Volo.Abp.BackgroundWorkers.Quartz/Volo/Abp/BackgroundWorkers/Quartz/IQuartzBackgroundWorker.cs new file mode 100644 index 0000000000..ffc2117e6f --- /dev/null +++ b/framework/src/Volo.Abp.BackgroundWorkers.Quartz/Volo/Abp/BackgroundWorkers/Quartz/IQuartzBackgroundWorker.cs @@ -0,0 +1,11 @@ +using Quartz; + +namespace Volo.Abp.BackgroundWorkers.Quartz +{ + public interface IQuartzBackgroundWorker : IBackgroundWorker, IJob + { + ITrigger Trigger { get; set; } + + IJobDetail JobDetail { get; set; } + } +} diff --git a/framework/src/Volo.Abp.BackgroundWorkers.Quartz/Volo/Abp/BackgroundWorkers/Quartz/QuartzBackgroundWorkerBase.cs b/framework/src/Volo.Abp.BackgroundWorkers.Quartz/Volo/Abp/BackgroundWorkers/Quartz/QuartzBackgroundWorkerBase.cs new file mode 100644 index 0000000000..e468ac80f5 --- /dev/null +++ b/framework/src/Volo.Abp.BackgroundWorkers.Quartz/Volo/Abp/BackgroundWorkers/Quartz/QuartzBackgroundWorkerBase.cs @@ -0,0 +1,14 @@ +using System.Threading.Tasks; +using Quartz; + +namespace Volo.Abp.BackgroundWorkers.Quartz +{ + public abstract class QuartzBackgroundWorkerBase : BackgroundWorkerBase, IQuartzBackgroundWorker + { + public ITrigger Trigger { get; set; } + + public IJobDetail JobDetail { get; set; } + + public abstract Task Execute(IJobExecutionContext context); + } +} diff --git a/framework/src/Volo.Abp.BackgroundWorkers.Quartz/Volo/Abp/BackgroundWorkers/Quartz/QuartzBackgroundWorkerManager.cs b/framework/src/Volo.Abp.BackgroundWorkers.Quartz/Volo/Abp/BackgroundWorkers/Quartz/QuartzBackgroundWorkerManager.cs new file mode 100644 index 0000000000..46568a5a11 --- /dev/null +++ b/framework/src/Volo.Abp.BackgroundWorkers.Quartz/Volo/Abp/BackgroundWorkers/Quartz/QuartzBackgroundWorkerManager.cs @@ -0,0 +1,43 @@ +using System.Threading; +using System.Threading.Tasks; +using Quartz; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Threading; + +namespace Volo.Abp.BackgroundWorkers.Quartz +{ + [Dependency(ReplaceServices = true)] + public class QuartzBackgroundWorkerManager : IBackgroundWorkerManager, ISingletonDependency + { + private readonly IScheduler _scheduler; + + public QuartzBackgroundWorkerManager(IScheduler scheduler) + { + _scheduler = scheduler; + } + + public async Task StartAsync(CancellationToken cancellationToken = default) + { + await _scheduler.ResumeAll(cancellationToken); + } + + public async Task StopAsync(CancellationToken cancellationToken = default) + { + if (!_scheduler.IsShutdown) + { + await _scheduler.PauseAll(cancellationToken); + } + } + + public void Add(IBackgroundWorker worker) + { + if (worker is IQuartzBackgroundWorker quartzWork) + { + Check.NotNull(quartzWork.Trigger, nameof(quartzWork.Trigger)); + Check.NotNull(quartzWork.JobDetail, nameof(quartzWork.JobDetail)); + + AsyncHelper.RunSync(() => _scheduler.ScheduleJob(quartzWork.JobDetail, quartzWork.Trigger)); + } + } + } +} diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs index 58adc65fc4..b37f67fd1a 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs @@ -16,10 +16,12 @@ namespace Volo.Abp.Cli.Commands public ILogger Logger { get; set; } protected SolutionModuleAdder SolutionModuleAdder { get; } + public SolutionAbpVersionFinder SolutionAbpVersionFinder { get; } - public AddModuleCommand(SolutionModuleAdder solutionModuleAdder) + public AddModuleCommand(SolutionModuleAdder solutionModuleAdder, SolutionAbpVersionFinder solutionAbpVersionFinder) { SolutionModuleAdder = solutionModuleAdder; + SolutionAbpVersionFinder = solutionAbpVersionFinder; Logger = NullLogger.Instance; } @@ -34,14 +36,26 @@ namespace Volo.Abp.Cli.Commands ); } + var withSourceCode = commandLineArgs.Options.ContainsKey("with-source-code"); + var skipDbMigrations = Convert.ToBoolean( commandLineArgs.Options.GetOrNull(Options.DbMigrations.Skip) ?? "false"); + var solutionFile = GetSolutionFile(commandLineArgs); + + var version = commandLineArgs.Options.GetOrNull(Options.Version.Short, Options.Version.Long); + if (version == null) + { + version = SolutionAbpVersionFinder.Find(solutionFile); + } + await SolutionModuleAdder.AddAsync( - GetSolutionFile(commandLineArgs), + solutionFile, commandLineArgs.Target, commandLineArgs.Options.GetOrNull(Options.StartupProject.Short, Options.StartupProject.Long), - skipDbMigrations + version, + skipDbMigrations, + withSourceCode ); } @@ -57,8 +71,9 @@ namespace Volo.Abp.Cli.Commands sb.AppendLine(" abp add-module [options]"); sb.AppendLine(""); sb.AppendLine("Options:"); - sb.AppendLine(" -s|--solution Specify the solution file explicitly."); - sb.AppendLine(" --skip-db-migrations Specify if a new migration will be added or not."); + sb.AppendLine(" --with-source-code Downloads the source code of the module and adds it to your solution."); + sb.AppendLine(" -s|--solution Specify the solution file explicitly."); + sb.AppendLine(" --skip-db-migrations Specify if a new migration will be added or not."); sb.AppendLine(" -sp|--startup-project Relative path to the project folder of the startup project. Default value is the current folder."); sb.AppendLine(""); sb.AppendLine("Examples:"); @@ -126,6 +141,11 @@ namespace Volo.Abp.Cli.Commands public const string Short = "s"; public const string Long = "solution"; } + public static class Version + { + public const string Short = "v"; + public const string Long = "version"; + } public static class DbMigrations { diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GetSourceCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GetSourceCommand.cs index 9ad7eb5b49..c57833c1f7 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GetSourceCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GetSourceCommand.cs @@ -7,6 +7,7 @@ using ICSharpCode.SharpZipLib.Zip; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Volo.Abp.Cli.Args; +using Volo.Abp.Cli.Commands.Services; using Volo.Abp.Cli.ProjectBuilding; using Volo.Abp.Cli.ProjectBuilding.Building; using Volo.Abp.DependencyInjection; @@ -15,12 +16,14 @@ namespace Volo.Abp.Cli.Commands { public class GetSourceCommand : IConsoleCommand, ITransientDependency { + private readonly SourceCodeDownloadService _sourceCodeDownloadService; public ModuleProjectBuilder ModuleProjectBuilder { get; } public ILogger Logger { get; set; } - public GetSourceCommand(ModuleProjectBuilder moduleProjectBuilder) + public GetSourceCommand(ModuleProjectBuilder moduleProjectBuilder, SourceCodeDownloadService sourceCodeDownloadService) { + _sourceCodeDownloadService = sourceCodeDownloadService; ModuleProjectBuilder = moduleProjectBuilder; Logger = NullLogger.Instance; } @@ -36,29 +39,13 @@ namespace Volo.Abp.Cli.Commands ); } - Logger.LogInformation("Downloading source code of " + commandLineArgs.Target); - var version = commandLineArgs.Options.GetOrNull(Options.Version.Short, Options.Version.Long); if (version != null) { Logger.LogInformation("Version: " + version); } - var outputFolder = commandLineArgs.Options.GetOrNull(Options.OutputFolder.Short, Options.OutputFolder.Long); - if (outputFolder != null) - { - if (!Directory.Exists(outputFolder)) - { - Directory.CreateDirectory(outputFolder); - } - - outputFolder = Path.GetFullPath(outputFolder); - } - else - { - outputFolder = Directory.GetCurrentDirectory(); - } - + var outputFolder = GetOutPutFolder(commandLineArgs); Logger.LogInformation("Output folder: " + outputFolder); var gitHubLocalRepositoryPath = commandLineArgs.Options.GetOrNull(Options.GitHubLocalRepositoryPath.Long); @@ -68,54 +55,29 @@ namespace Volo.Abp.Cli.Commands } commandLineArgs.Options.Add(CliConsts.Command, commandLineArgs.Command); + + await _sourceCodeDownloadService.DownloadAsync( + commandLineArgs.Target, outputFolder, version, gitHubLocalRepositoryPath, commandLineArgs.Options); + } - var result = await ModuleProjectBuilder.BuildAsync( - new ProjectBuildArgs( - SolutionName.Parse(commandLineArgs.Target), - commandLineArgs.Target, - version, - DatabaseProvider.NotSpecified, - UiFramework.NotSpecified, - MobileApp.None, - gitHubLocalRepositoryPath, - commandLineArgs.Options - ) - ); - - using (var templateFileStream = new MemoryStream(result.ZipContent)) + private static string GetOutPutFolder(CommandLineArgs commandLineArgs) + { + var outputFolder = commandLineArgs.Options.GetOrNull(Options.OutputFolder.Short, Options.OutputFolder.Long); + if (outputFolder != null) { - using (var zipInputStream = new ZipInputStream(templateFileStream)) + if (!Directory.Exists(outputFolder)) { - var zipEntry = zipInputStream.GetNextEntry(); - while (zipEntry != null) - { - var fullZipToPath = Path.Combine(outputFolder, zipEntry.Name); - var directoryName = Path.GetDirectoryName(fullZipToPath); - - if (!string.IsNullOrEmpty(directoryName)) - { - Directory.CreateDirectory(directoryName); - } - - var fileName = Path.GetFileName(fullZipToPath); - if (fileName.Length == 0) - { - zipEntry = zipInputStream.GetNextEntry(); - continue; - } - - var buffer = new byte[4096]; // 4K is optimum - using (var streamWriter = File.Create(fullZipToPath)) - { - StreamUtils.Copy(zipInputStream, streamWriter, buffer); - } - - zipEntry = zipInputStream.GetNextEntry(); - } + Directory.CreateDirectory(outputFolder); } + + outputFolder = Path.GetFullPath(outputFolder); + } + else + { + outputFolder = Directory.GetCurrentDirectory(); } - Logger.LogInformation($"'{commandLineArgs.Target}' has been successfully downloaded to '{outputFolder}'"); + return outputFolder; } public string GetUsageInfo() diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs index d39a333860..f25a4ad89f 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs @@ -30,7 +30,7 @@ namespace Volo.Abp.Cli.Commands public async Task ExecuteAsync(CommandLineArgs commandLineArgs) { var projectName = NamespaceHelper.NormalizeNamespace(commandLineArgs.Target); - + if (projectName == null) { throw new CliUsageException( @@ -39,7 +39,7 @@ namespace Volo.Abp.Cli.Commands GetUsageInfo() ); } - + Logger.LogInformation("Creating your project..."); Logger.LogInformation("Project name: " + projectName); @@ -79,6 +79,12 @@ namespace Volo.Abp.Cli.Commands Logger.LogInformation("GitHub Local Repository Path: " + gitHubLocalRepositoryPath); } + var templateSource = commandLineArgs.Options.GetOrNull(Options.TemplateSource.Short, Options.TemplateSource.Long); + if (templateSource != null) + { + Logger.LogInformation("Template Source: " + templateSource); + } + var outputFolder = commandLineArgs.Options.GetOrNull(Options.OutputFolder.Short, Options.OutputFolder.Long); outputFolder = Path.Combine(outputFolder != null ? Path.GetFullPath(outputFolder) : Directory.GetCurrentDirectory(), @@ -102,6 +108,7 @@ namespace Volo.Abp.Cli.Commands uiFramework, mobileApp, gitHubLocalRepositoryPath, + templateSource, commandLineArgs.Options ) ); @@ -158,6 +165,7 @@ namespace Volo.Abp.Cli.Commands sb.AppendLine("-d|--database-provider (if supported by the template)"); sb.AppendLine("-o|--output-folder (default: current folder)"); sb.AppendLine("-v|--version (default: latest version)"); + sb.AppendLine("-ts|--template-source (your local or network abp template source)"); sb.AppendLine("--tiered (if supported by the template)"); sb.AppendLine("--no-ui (if supported by the template)"); sb.AppendLine("--separate-identity-server (if supported by the template)"); @@ -173,6 +181,7 @@ namespace Volo.Abp.Cli.Commands sb.AppendLine(" abp new Acme.BookStore -d mongodb -o d:\\my-project"); sb.AppendLine(" abp new Acme.BookStore -t module"); sb.AppendLine(" abp new Acme.BookStore -t module --no-ui"); + sb.AppendLine(" abp new Acme.BookStore -ts \"D:\\localTemplate\\abp\""); sb.AppendLine(" abp new Acme.BookStore --local-framework-ref --abp-path \"D:\\github\\abp\""); sb.AppendLine(""); sb.AppendLine("See the documentation for more info: https://docs.abp.io/en/abp/latest/CLI"); @@ -271,6 +280,12 @@ namespace Volo.Abp.Cli.Commands public const string Short = "m"; public const string Long = "mobile"; } + + public static class TemplateSource + { + public const string Short = "ts"; + public const string Long = "template-source"; + } } } } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/SourceCodeDownloadService.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/SourceCodeDownloadService.cs new file mode 100644 index 0000000000..7c8d068e1e --- /dev/null +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/SourceCodeDownloadService.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading.Tasks; +using ICSharpCode.SharpZipLib.Core; +using ICSharpCode.SharpZipLib.Zip; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using Volo.Abp.Cli.Args; +using Volo.Abp.Cli.ProjectBuilding; +using Volo.Abp.Cli.ProjectBuilding.Building; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.Cli.Commands.Services +{ + public class SourceCodeDownloadService : ITransientDependency + { + public ModuleProjectBuilder ModuleProjectBuilder { get; } + public ILogger Logger { get; set; } + + public SourceCodeDownloadService(ModuleProjectBuilder moduleProjectBuilder) + { + ModuleProjectBuilder = moduleProjectBuilder; + Logger = NullLogger.Instance; + } + + public async Task DownloadAsync(string moduleName, string outputFolder, string version, string gitHubLocalRepositoryPath, AbpCommandLineOptions options) + { + Logger.LogInformation("Downloading source code of " + moduleName); + Logger.LogInformation("Version: " + version); + Logger.LogInformation("Output folder: " + outputFolder); + + var result = await ModuleProjectBuilder.BuildAsync( + new ProjectBuildArgs( + SolutionName.Parse(moduleName), + moduleName, + version, + DatabaseProvider.NotSpecified, + UiFramework.NotSpecified, + null, + gitHubLocalRepositoryPath, + null, + options + ) + ); + + using (var templateFileStream = new MemoryStream(result.ZipContent)) + { + using (var zipInputStream = new ZipInputStream(templateFileStream)) + { + var zipEntry = zipInputStream.GetNextEntry(); + while (zipEntry != null) + { + var fullZipToPath = Path.Combine(outputFolder, zipEntry.Name); + var directoryName = Path.GetDirectoryName(fullZipToPath); + + if (!string.IsNullOrEmpty(directoryName)) + { + Directory.CreateDirectory(directoryName); + } + + var fileName = Path.GetFileName(fullZipToPath); + if (fileName.Length == 0) + { + zipEntry = zipInputStream.GetNextEntry(); + continue; + } + + var buffer = new byte[4096]; // 4K is optimum + using (var streamWriter = File.Create(fullZipToPath)) + { + StreamUtils.Copy(zipInputStream, streamWriter, buffer); + } + + zipEntry = zipInputStream.GetNextEntry(); + } + } + } + + Logger.LogInformation($"'{moduleName}' has been successfully downloaded to '{outputFolder}'"); + } + } +} 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 fd0a0e5246..03504251f5 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 @@ -2,9 +2,7 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; using System.Net.Http; using System.Text; using System.Threading.Tasks; @@ -46,7 +44,8 @@ namespace Volo.Abp.Cli.ProjectBuilding public async Task GetAsync( string name, string type, - string version = null) + string version = null, + string templateSource = null) { var latestVersion = await GetLatestSourceCodeVersionAsync(name, type); @@ -57,8 +56,14 @@ namespace Volo.Abp.Cli.ProjectBuilding DirectoryHelper.CreateIfNotExists(CliPaths.TemplateCache); + if (!string.IsNullOrWhiteSpace(templateSource) && !IsNetworkSource(templateSource)) + { + Logger.LogInformation("Using local " + type + ": " + name + ", version: " + version); + return new TemplateFile(File.ReadAllBytes(Path.Combine(templateSource, name + "-" + version + ".zip")), version, latestVersion); + } + var localCacheFile = Path.Combine(CliPaths.TemplateCache, name + "-" + version + ".zip"); - if (Options.CacheTemplates && File.Exists(localCacheFile)) + if (Options.CacheTemplates && File.Exists(localCacheFile) && templateSource.IsNullOrWhiteSpace()) { Logger.LogInformation("Using cached " + type + ": " + name + ", version: " + version); return new TemplateFile(File.ReadAllBytes(localCacheFile), version, latestVersion); @@ -71,11 +76,12 @@ namespace Volo.Abp.Cli.ProjectBuilding { Name = name, Type = type, + TemplateSource = templateSource, Version = version } ); - if (Options.CacheTemplates) + if (Options.CacheTemplates && templateSource.IsNullOrWhiteSpace()) { File.WriteAllBytes(localCacheFile, fileContent); } @@ -114,11 +120,20 @@ namespace Volo.Abp.Cli.ProjectBuilding using (var client = new CliHttpClient(TimeSpan.FromMinutes(10))) { - var responseMessage = await client.PostAsync( - $"{CliUrls.WwwAbpIo}api/download/{input.Type}/", - new StringContent(postData, Encoding.UTF8, MimeTypes.Application.Json), - CancellationTokenProvider.Token - ); + HttpResponseMessage responseMessage; + + if (input.TemplateSource.IsNullOrWhiteSpace()) + { + responseMessage = await client.PostAsync( + $"{CliUrls.WwwAbpIo}api/download/{input.Type}/", + new StringContent(postData, Encoding.UTF8, MimeTypes.Application.Json), + CancellationTokenProvider.Token + ); + } + else + { + responseMessage = await client.GetAsync(input.TemplateSource, CancellationTokenProvider.Token); + } await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(responseMessage); @@ -126,6 +141,11 @@ namespace Volo.Abp.Cli.ProjectBuilding } } + private bool IsNetworkSource(string source) + { + return source.ToLower().StartsWith("http"); + } + public class SourceCodeDownloadInputDto { public string Name { get; set; } @@ -133,6 +153,8 @@ namespace Volo.Abp.Cli.ProjectBuilding public string Version { get; set; } public string Type { get; set; } + + public string TemplateSource { get; set; } } public class GetLatestSourceCodeVersionDto diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/ModuleProjectBuildPipelineBuilder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/ModuleProjectBuildPipelineBuilder.cs index 5eba01b388..9b66f17834 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/ModuleProjectBuildPipelineBuilder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/ModuleProjectBuildPipelineBuilder.cs @@ -11,6 +11,7 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building pipeline.Steps.Add(new FileEntryListReadStep()); pipeline.Steps.Add(new ProjectReferenceReplaceStep()); pipeline.Steps.Add(new ReplaceCommonPropsStep()); + pipeline.Steps.Add(new ReplaceConfigureAwaitPropsStep()); pipeline.Steps.Add(new CreateProjectResultZipStep()); return pipeline; diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ProjectReferenceReplaceStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ProjectReferenceReplaceStep.cs index 29f5afb19c..a7fd3f529f 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ProjectReferenceReplaceStep.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ProjectReferenceReplaceStep.cs @@ -4,6 +4,7 @@ using System.IO; using System.Text.RegularExpressions; using System.Xml; using Volo.Abp.Cli.ProjectBuilding.Files; +using Volo.Abp.Cli.Utils; namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps { @@ -92,7 +93,7 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps var doc = new XmlDocument() { PreserveWhitespace = true }; - doc.Load(GenerateStreamFromString(content)); + doc.Load(StreamHelper.GenerateStreamFromString(content)); return ProcessReferenceNodes(doc, content); } @@ -125,16 +126,6 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps protected abstract XmlElement GetNewReferenceNode(XmlDocument doc, string oldNodeIncludeValue); - private static Stream GenerateStreamFromString(string s) - { - var stream = new MemoryStream(); - var writer = new StreamWriter(stream); - writer.Write(s); - writer.Flush(); - stream.Position = 0; - return stream; - } - public class NugetReferenceReplacer : ProjectReferenceReplacer { diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ReplaceCommonPropsStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ReplaceCommonPropsStep.cs index 07b2081738..862ac39b09 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ReplaceCommonPropsStep.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ReplaceCommonPropsStep.cs @@ -4,6 +4,7 @@ using System.IO; using System.Text.RegularExpressions; using System.Xml; using Volo.Abp.Cli.ProjectBuilding.Files; +using Volo.Abp.Cli.Utils; namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps { @@ -41,7 +42,7 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps var doc = new XmlDocument() { PreserveWhitespace = true }; - doc.Load(GenerateStreamFromString(content)); + doc.Load(StreamHelper.GenerateStreamFromString(content)); return ProcessReferenceNodes(doc, content); } @@ -81,16 +82,6 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps return doc.OuterXml; } - - private static Stream GenerateStreamFromString(string s) - { - var stream = new MemoryStream(); - var writer = new StreamWriter(stream); - writer.Write(s); - writer.Flush(); - stream.Position = 0; - return stream; - } } } } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ReplaceConfigureAwaitPropsStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ReplaceConfigureAwaitPropsStep.cs new file mode 100644 index 0000000000..1541284009 --- /dev/null +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ReplaceConfigureAwaitPropsStep.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.RegularExpressions; +using System.Xml; +using Volo.Abp.Cli.ProjectBuilding.Files; +using Volo.Abp.Cli.Utils; + +namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps +{ + public class ReplaceConfigureAwaitPropsStep : ProjectBuildPipelineStep + { + public override void Execute(ProjectBuildContext context) + { + new ConfigureAwaitPropsReplacer(context.Files).Run(); + } + + private class ConfigureAwaitPropsReplacer + { + private readonly List _entries; + + public ConfigureAwaitPropsReplacer( + List entries) + { + _entries = entries; + } + + public void Run() + { + foreach (var fileEntry in _entries) + { + if (fileEntry.Name.EndsWith(".csproj")) + { + fileEntry.SetContent(ProcessFileContent(fileEntry.Content)); + } + } + } + + private string ProcessFileContent(string content) + { + Check.NotNull(content, nameof(content)); + + var doc = new XmlDocument() { PreserveWhitespace = true }; + + doc.Load(StreamHelper.GenerateStreamFromString(content)); + + return ProcessReferenceNodes(doc, content); + } + + private string ProcessReferenceNodes(XmlDocument doc, string content) + { + Check.NotNull(content, nameof(content)); + + var importNodes = doc.SelectNodes("/Project/Import[@Project]"); + + if (importNodes == null) + { + return doc.OuterXml; + } + + foreach (XmlNode node in importNodes) + { + if (!(node.Attributes?["Project"]?.Value?.EndsWith("\\configureawait.props") ?? false)) + { + continue; + } + + node.ParentNode?.RemoveChild(node); + } + + return doc.OuterXml; + } + } + } +} diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ISourceCodeStore.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ISourceCodeStore.cs index 4d1ed7aa0c..de082d4bcf 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ISourceCodeStore.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ISourceCodeStore.cs @@ -8,7 +8,8 @@ namespace Volo.Abp.Cli.ProjectBuilding Task GetAsync( string name, string type, - [CanBeNull] string version = null + [CanBeNull] string version = null, + [CanBeNull] string templateSource = null ); } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ModuleProjectBuilder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ModuleProjectBuilder.cs index 48f109e1d3..6a7132769a 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ModuleProjectBuilder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ModuleProjectBuilder.cs @@ -83,6 +83,8 @@ namespace Volo.Abp.Cli.ProjectBuilding !x.Key.Equals(NewCommand.Options.OutputFolder.Short, StringComparison.InvariantCultureIgnoreCase)) .Where(x => !x.Key.Equals(NewCommand.Options.Version.Long, StringComparison.InvariantCultureIgnoreCase) && !x.Key.Equals(NewCommand.Options.Version.Short, StringComparison.InvariantCultureIgnoreCase)) + .Where(x => !x.Key.Equals(NewCommand.Options.TemplateSource.Short, StringComparison.InvariantCultureIgnoreCase) && + !x.Key.Equals(NewCommand.Options.TemplateSource.Long, StringComparison.InvariantCultureIgnoreCase)) .Select(x => x.Key).ToList(); await CliAnalyticsCollect.CollectAsync(new CliAnalyticsCollectInputDto diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ProjectBuildArgs.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ProjectBuildArgs.cs index bb20c19e80..ea207bc426 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ProjectBuildArgs.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ProjectBuildArgs.cs @@ -19,22 +19,26 @@ namespace Volo.Abp.Cli.ProjectBuilding public UiFramework UiFramework { get; set; } - public MobileApp MobileApp { get; set; } + public MobileApp? MobileApp { get; set; } [CanBeNull] public string AbpGitHubLocalRepositoryPath { get; set; } + [CanBeNull] + public string TemplateSource { get; set; } + [NotNull] public Dictionary ExtraProperties { get; set; } public ProjectBuildArgs( - [NotNull] SolutionName solutionName, + [NotNull] SolutionName solutionName, [CanBeNull] string templateName = null, [CanBeNull] string version = null, DatabaseProvider databaseProvider = DatabaseProvider.NotSpecified, UiFramework uiFramework = UiFramework.NotSpecified, - MobileApp mobileApp = MobileApp.ReactNative, + MobileApp? mobileApp = null, [CanBeNull] string abpGitHubLocalRepositoryPath = null, + [CanBeNull] string templateSource = null, Dictionary extraProperties = null) { SolutionName = Check.NotNull(solutionName, nameof(solutionName)); @@ -44,6 +48,7 @@ namespace Volo.Abp.Cli.ProjectBuilding UiFramework = uiFramework; MobileApp = mobileApp; AbpGitHubLocalRepositoryPath = abpGitHubLocalRepositoryPath; + TemplateSource = templateSource; ExtraProperties = extraProperties ?? new Dictionary(); } } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateProjectBuilder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateProjectBuilder.cs index 80a25660fc..f7d9eaf3be 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateProjectBuilder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateProjectBuilder.cs @@ -24,11 +24,11 @@ namespace Volo.Abp.Cli.ProjectBuilding protected IJsonSerializer JsonSerializer { get; } protected IApiKeyService ApiKeyService { get; } - public TemplateProjectBuilder(ISourceCodeStore sourceCodeStore, + public TemplateProjectBuilder(ISourceCodeStore sourceCodeStore, ITemplateInfoProvider templateInfoProvider, - ICliAnalyticsCollect cliAnalyticsCollect, + ICliAnalyticsCollect cliAnalyticsCollect, IOptions options, - IJsonSerializer jsonSerializer, + IJsonSerializer jsonSerializer, IApiKeyService apiKeyService) { SourceCodeStore = sourceCodeStore; @@ -40,7 +40,7 @@ namespace Volo.Abp.Cli.ProjectBuilding Logger = NullLogger.Instance; } - + public async Task BuildAsync(ProjectBuildArgs args) { var templateInfo = GetTemplateInfo(args); @@ -50,9 +50,10 @@ namespace Volo.Abp.Cli.ProjectBuilding var templateFile = await SourceCodeStore.GetAsync( args.TemplateName, SourceCodeTypes.Template, - args.Version + args.Version, + args.TemplateSource ); - + var apiKeyResult = await ApiKeyService.GetApiKeyOrNullAsync(); if (apiKeyResult?.ApiKey != null) { @@ -82,7 +83,7 @@ namespace Volo.Abp.Cli.ProjectBuilding var options = args.ExtraProperties .Where(x => !x.Key.Equals(CliConsts.Command, StringComparison.InvariantCultureIgnoreCase)) .Where(x => !x.Key.Equals("tiered", StringComparison.InvariantCultureIgnoreCase)) - .Where(x => !x.Key.Equals(NewCommand.Options.DatabaseProvider.Long, StringComparison.InvariantCultureIgnoreCase) && + .Where(x => !x.Key.Equals(NewCommand.Options.DatabaseProvider.Long, StringComparison.InvariantCultureIgnoreCase) && !x.Key.Equals(NewCommand.Options.DatabaseProvider.Short, StringComparison.InvariantCultureIgnoreCase)) .Where(x => !x.Key.Equals(NewCommand.Options.OutputFolder.Long, StringComparison.InvariantCultureIgnoreCase) && !x.Key.Equals(NewCommand.Options.OutputFolder.Short, StringComparison.InvariantCultureIgnoreCase)) @@ -92,6 +93,8 @@ namespace Volo.Abp.Cli.ProjectBuilding !x.Key.Equals(NewCommand.Options.Mobile.Short, StringComparison.InvariantCultureIgnoreCase)) .Where(x => !x.Key.Equals(NewCommand.Options.Version.Long, StringComparison.InvariantCultureIgnoreCase) && !x.Key.Equals(NewCommand.Options.Version.Short, StringComparison.InvariantCultureIgnoreCase)) + .Where(x => !x.Key.Equals(NewCommand.Options.TemplateSource.Short, StringComparison.InvariantCultureIgnoreCase) && + !x.Key.Equals(NewCommand.Options.TemplateSource.Long, StringComparison.InvariantCultureIgnoreCase)) .Select(x => x.Key).ToList(); await CliAnalyticsCollect.CollectAsync(new CliAnalyticsCollectInputDto diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/DbContextFileBuilderConfigureAdder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/DbContextFileBuilderConfigureAdder.cs index 0211a42243..d369a9af43 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/DbContextFileBuilderConfigureAdder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/DbContextFileBuilderConfigureAdder.cs @@ -18,7 +18,7 @@ namespace Volo.Abp.Cli.ProjectModification Logger = NullLogger.Instance; } - public void Add(string path, string moduleConfiguration) + public bool Add(string path, string moduleConfiguration) { var file = File.ReadAllText(path); @@ -32,13 +32,18 @@ namespace Volo.Abp.Cli.ProjectModification if (indexToInsert <= 0 || indexToInsert >= file.Length) { Logger.LogWarning($"\"OnModelCreating(ModelBuilder builder)\" method couldn't be found in {path}"); - return; + return false; } file = file.Insert(indexToInsert, " " + stringToAdd + Environment.NewLine + " "); } + else + { + return false; + } File.WriteAllText(path, file); + return true; } protected int FindIndexToInsert(string file) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/DerivedClassFinder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/DerivedClassFinder.cs index 4cf3209955..8da03763c6 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/DerivedClassFinder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/DerivedClassFinder.cs @@ -53,7 +53,6 @@ namespace Volo.Abp.Cli.ProjectModification protected bool IsDerived(string csFile, string baseClass) { - Logger.LogDebug(csFile); var root = CSharpSyntaxTree.ParseText(File.ReadAllText(csFile)).GetRoot(); var namespaceSyntax = root.DescendantNodes().OfType().First(); var classDeclaration = (namespaceSyntax.DescendantNodes().OfType()).First(); diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ModuleWithMastersInfo.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ModuleWithMastersInfo.cs new file mode 100644 index 0000000000..07d6e12349 --- /dev/null +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ModuleWithMastersInfo.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic; + +namespace Volo.Abp.Cli.ProjectModification +{ + public class ModuleWithMastersInfo : ModuleInfo + { + public List MasterModuleInfos { get; set; } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NugetPackageToLocalReferenceConverter.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NugetPackageToLocalReferenceConverter.cs new file mode 100644 index 0000000000..8f566234c2 --- /dev/null +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NugetPackageToLocalReferenceConverter.cs @@ -0,0 +1,140 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml; +using Volo.Abp.Cli.Utils; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.Cli.ProjectModification +{ + public class NugetPackageToLocalReferenceConverter : ITransientDependency + { + public async Task Convert(ModuleWithMastersInfo module, string solutionFile) + { + var nugetPackageList = GetNugetPackages(module); + var modulesFolder = Path.Combine(Path.GetDirectoryName(solutionFile), "modules"); + var srcFolder = Path.Combine(Path.GetDirectoryName(solutionFile), "src"); + var testFolder = Path.Combine(Path.GetDirectoryName(solutionFile), "test"); + + ConvertToLocalReference(modulesFolder, nugetPackageList, "..\\..\\..\\"); + ConvertToLocalReference(srcFolder, nugetPackageList, "..\\..\\modules\\"); + ConvertToLocalReference(testFolder, nugetPackageList, "..\\..\\modules\\", "test"); + } + + private void ConvertToLocalReference(string folder, List nugetPackageList, string localPathPrefix, string sourceFile = "src") + { + var projectFiles = GetProjectFilesUnder(folder); + + foreach (var projectFile in projectFiles) + { + var content = File.ReadAllText(projectFile); + var doc = new XmlDocument() { PreserveWhitespace = true }; + + doc.Load(StreamHelper.GenerateStreamFromString(content)); + + var convertedProject = ProcessReferenceNodes(folder, doc, nugetPackageList, localPathPrefix, sourceFile); + + File.WriteAllText(projectFile, convertedProject); + } + } + + private string ProcessReferenceNodes(string folder, XmlDocument doc, List nugetPackageList, string localPathPrefix, string sourceFile = "src") + { + var nodes = doc.SelectNodes("/Project/ItemGroup/PackageReference[starts-with(@Include, 'Volo.Abp')]"); + + if (nodes == null) + { + return doc.OuterXml; + } + + foreach (XmlNode oldNode in nodes) + { + var oldNodeIncludeValue = oldNode?.Attributes?["Include"]?.Value; + + var moduleName = nugetPackageList.FirstOrDefault(n => n.NugetPackage.Name == oldNodeIncludeValue)?.ModuleName; + + if (moduleName == null) + { + var localProject = GetProjectFilesUnder(folder).FirstOrDefault(f=> f.EndsWith($"{oldNodeIncludeValue}.csproj")); + + if (localProject != null) + { + moduleName = Directory.GetParent(Directory.GetParent(Path.GetDirectoryName(localProject)).FullName).Name; + + if (oldNodeIncludeValue.EndsWith(".test", StringComparison.InvariantCultureIgnoreCase) || + oldNodeIncludeValue.EndsWith(".tests", StringComparison.InvariantCultureIgnoreCase)) + { + sourceFile = "test"; + } + else + { + sourceFile = "src"; + } + } + else + { + continue; + } + } + + var referenceProjectPath = + $"{localPathPrefix}{moduleName}\\{sourceFile}\\{oldNodeIncludeValue}\\{oldNodeIncludeValue}.csproj"; + + XmlNode newNode = GetNewReferenceNode(doc, referenceProjectPath); + + oldNode?.ParentNode?.ReplaceChild(newNode, oldNode); + } + + return doc.OuterXml; + } + + protected XmlElement GetNewReferenceNode(XmlDocument doc, string newValue) + { + var newNode = doc.CreateElement("ProjectReference"); + + var includeAttr = doc.CreateAttribute("Include"); + includeAttr.Value = newValue; + newNode.Attributes.Append(includeAttr); + + return newNode; + } + + public List GetNugetPackages(ModuleWithMastersInfo module) + { + var list = new List(); + + list.AddRange(module.NugetPackages.Select(n => new NugetPackageInfoWithModuleName + { + ModuleName = module.Name, + NugetPackage = n + })); + + if (module.MasterModuleInfos != null) + { + foreach (var masterModule in module.MasterModuleInfos) + { + list.AddRange(GetNugetPackages(masterModule)); + } + } + + return list; + } + + private static string[] GetProjectFilesUnder(string path) + { + return Directory.GetFiles(path, + "*.csproj", + SearchOption.AllDirectories); + } + + public class NugetPackageInfoWithModuleName + { + public NugetPackageInfo NugetPackage { get; set; } + + public string ModuleName { get; set; } + } + } +} diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNpmPackageAdder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNpmPackageAdder.cs index 63e0eb0393..eeb19e8621 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNpmPackageAdder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNpmPackageAdder.cs @@ -20,7 +20,7 @@ namespace Volo.Abp.Cli.ProjectModification public Task AddAsync(string directory, NpmPackageInfo npmPackage) { var packageJsonFilePath = Path.Combine(directory, "package.json"); - if (!File.Exists(packageJsonFilePath)) + if (!File.Exists(packageJsonFilePath) || File.ReadAllText(packageJsonFilePath).Contains($"\"{npmPackage.Name}\"")) { return Task.CompletedTask; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNugetPackageAdder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNugetPackageAdder.cs index 62dee30344..a69957a497 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNugetPackageAdder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNugetPackageAdder.cs @@ -50,6 +50,11 @@ namespace Volo.Abp.Cli.ProjectModification public Task AddAsync(string projectFile, NugetPackageInfo package) { + if (File.ReadAllText(projectFile).Contains($"\"{package.Name}\"")) + { + return Task.CompletedTask; + } + using (DirectoryHelper.ChangeCurrentDirectory(Path.GetDirectoryName(projectFile))) { Logger.LogInformation($"Installing '{package.Name}' package to the project '{Path.GetFileNameWithoutExtension(projectFile)}'..."); diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionAbpVersionFinder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionAbpVersionFinder.cs new file mode 100644 index 0000000000..a86d17fee2 --- /dev/null +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionAbpVersionFinder.cs @@ -0,0 +1,36 @@ +using System.IO; +using System.Xml; +using Volo.Abp.Cli.Utils; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.Cli.ProjectModification +{ + public class SolutionAbpVersionFinder : ITransientDependency + { + public string Find(string solutionFile) + { + var projectFilesUnderSrc = Directory.GetFiles(Path.GetDirectoryName(solutionFile), + "*.csproj", + SearchOption.AllDirectories); + + foreach (var projectFile in projectFilesUnderSrc) + { + var content = File.ReadAllText(projectFile); + var doc = new XmlDocument() { PreserveWhitespace = true }; + + doc.Load(StreamHelper.GenerateStreamFromString(content)); + + var nodes = doc.SelectNodes("/Project/ItemGroup/PackageReference[starts-with(@Include, 'Volo.Abp')]"); + + var value = nodes?[0]?.Attributes?["Version"]?.Value; + + if (value != null) + { + return value; + } + } + + return null; + } + } +} diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionFileModifier.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionFileModifier.cs new file mode 100644 index 0000000000..4eabeaa846 --- /dev/null +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionFileModifier.cs @@ -0,0 +1,117 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.Cli.ProjectModification +{ + public class SolutionFileModifier : ITransientDependency + { + public async Task AddModuleToSolutionFileAsync(ModuleWithMastersInfo module, string solutionFile) + { + await AddModule(module, solutionFile); + } + + private async Task AddModule(ModuleWithMastersInfo module, string solutionFile) + { + var srcModuleFolderId = await AddNewFolderAndGetIdOrGetExistingId(solutionFile, module.Name, await AddNewFolderAndGetIdOrGetExistingId(solutionFile, "modules")); + var testModuleFolderId = await AddNewFolderAndGetIdOrGetExistingId(solutionFile, module.Name + ".Tests", await AddNewFolderAndGetIdOrGetExistingId(solutionFile, "test")); + + var file = File.ReadAllText(solutionFile); + var lines = file.Split(Environment.NewLine).ToList(); + + + var projectsUnderModule = Directory.GetFiles( + Path.Combine(Path.GetDirectoryName(solutionFile), "modules", module.Name), + "*.csproj", + SearchOption.AllDirectories); + + var projectsUnderTest = Directory.GetFiles( + Path.Combine(Path.GetDirectoryName(solutionFile), "modules", module.Name, "test"), + "*.csproj", + SearchOption.AllDirectories); + + foreach (var projectPath in projectsUnderModule) + { + var parentFolderId = projectsUnderTest.Contains(projectPath) ? testModuleFolderId : srcModuleFolderId; + var projectId = Path.GetFileName(projectPath).Replace(".csproj",""); + var projectParentFolderInModule = projectsUnderTest.Contains(projectPath) ? "test" : "src"; + + if (lines.Any(l => l.Contains($"\"{projectId}\""))) + { + continue; + } + + var projectGuid = Guid.NewGuid().ToString(); + + var newProjectLine = "Project(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"" + projectId + "\"," + + " \"modules\\" + module.Name + "\\"+ projectParentFolderInModule + "\\" + projectId + "\\" + projectId + ".csproj\", \"{" + projectGuid + "}\"" + + Environment.NewLine + "EndProject"; + + lines.InsertAfter(l => l.Trim().Equals("EndProject"), newProjectLine); + + var newPostSolutionLine = + " {" + projectGuid + "}.Debug|Any CPU.ActiveCfg = Debug|Any CPU" + Environment.NewLine + + " {" + projectGuid + "}.Debug|Any CPU.Build.0 = Debug|Any CPU" + Environment.NewLine + + " {" + projectGuid + "}.Release|Any CPU.ActiveCfg = Release|Any CPU" + Environment.NewLine + + " {" + projectGuid + "}.Release|Any CPU.Build.0 = Release|Any CPU"; + + lines.InsertAfter(l=>l.Contains("GlobalSection") && l.Contains("ProjectConfigurationPlatforms"), newPostSolutionLine); + + var newPreSolutionLine = + " {"+ projectGuid + "} = {"+ parentFolderId + "}"; + + lines.InsertAfter(l=>l.Contains("GlobalSection") && l.Contains("NestedProjects"), newPreSolutionLine); + } + + File.WriteAllText(solutionFile, string.Join(Environment.NewLine, lines)); + + if (module.MasterModuleInfos != null) + { + foreach (var masterModule in module.MasterModuleInfos) + { + await AddModule(masterModule, solutionFile); + } + } + } + + private async Task AddNewFolderAndGetIdOrGetExistingId(string solutionFile, string folderName, string parentFolderId = null) + { + var file = File.ReadAllText(solutionFile); + var lines = file.Split(Environment.NewLine).ToList(); + string folderId; + + var folderLineIndex = lines.FindIndex(l => + l.Contains("2150E333-8FDC-42A3-9474-1A3956D46DE8") && l.Contains("\""+ folderName + "\"")); + + if (folderLineIndex < 0) + { + folderId = Guid.NewGuid().ToString(); + var newFolderLine = "Project(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \""+ folderName + "\", \""+ folderName + "\", \"{" + folderId + "}\"" + + Environment.NewLine + "EndProject"; + + lines.InsertAfter(l => l.Trim().Equals("EndProject"), newFolderLine); + + if (parentFolderId != null) + { + var newPreSolutionLine = + " {" + folderId + "} = {" + parentFolderId + "}"; + + lines.InsertAfter(l => l.Contains("GlobalSection") && l.Contains("NestedProjects"), newPreSolutionLine); + } + } + else + { + folderId = lines[folderLineIndex].Replace("\"", " ").Replace("{", " ").Replace("}", " ").TrimEnd() + .Split(" ").Last(); + } + + File.WriteAllText(solutionFile, string.Join(Environment.NewLine, lines)); + + return folderId; + } + } +} diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs index d8a376eb02..8ded87bf6f 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs @@ -7,6 +7,7 @@ using System.IO; using System.Linq; using System.Net; using System.Threading.Tasks; +using Volo.Abp.Cli.Commands.Services; using Volo.Abp.Cli.Http; using Volo.Abp.Cli.ProjectBuilding; using Volo.Abp.DependencyInjection; @@ -26,6 +27,9 @@ namespace Volo.Abp.Cli.ProjectModification protected ProjectNpmPackageAdder ProjectNpmPackageAdder { get; } protected NpmGlobalPackagesChecker NpmGlobalPackagesChecker { get; } protected IRemoteServiceExceptionHandler RemoteServiceExceptionHandler { get; } + public SourceCodeDownloadService SourceCodeDownloadService { get; } + public SolutionFileModifier SolutionFileModifier { get; } + public NugetPackageToLocalReferenceConverter NugetPackageToLocalReferenceConverter { get; } public SolutionModuleAdder( IJsonSerializer jsonSerializer, @@ -35,7 +39,10 @@ namespace Volo.Abp.Cli.ProjectModification DerivedClassFinder derivedClassFinder, ProjectNpmPackageAdder projectNpmPackageAdder, NpmGlobalPackagesChecker npmGlobalPackagesChecker, - IRemoteServiceExceptionHandler remoteServiceExceptionHandler) + IRemoteServiceExceptionHandler remoteServiceExceptionHandler, + SourceCodeDownloadService sourceCodeDownloadService, + SolutionFileModifier solutionFileModifier, + NugetPackageToLocalReferenceConverter nugetPackageToLocalReferenceConverter) { JsonSerializer = jsonSerializer; ProjectNugetPackageAdder = projectNugetPackageAdder; @@ -45,6 +52,9 @@ namespace Volo.Abp.Cli.ProjectModification ProjectNpmPackageAdder = projectNpmPackageAdder; NpmGlobalPackagesChecker = npmGlobalPackagesChecker; RemoteServiceExceptionHandler = remoteServiceExceptionHandler; + SourceCodeDownloadService = sourceCodeDownloadService; + SolutionFileModifier = solutionFileModifier; + NugetPackageToLocalReferenceConverter = nugetPackageToLocalReferenceConverter; Logger = NullLogger.Instance; } @@ -52,7 +62,9 @@ namespace Volo.Abp.Cli.ProjectModification [NotNull] string solutionFile, [NotNull] string moduleName, string startupProject, - bool skipDbMigrations = false) + string version, + bool skipDbMigrations = false, + bool withSourceCode = false) { Check.NotNull(solutionFile, nameof(solutionFile)); Check.NotNull(moduleName, nameof(moduleName)); @@ -63,6 +75,42 @@ namespace Volo.Abp.Cli.ProjectModification var projectFiles = ProjectFinder.GetProjectFiles(solutionFile); + await AddNugetAndNpmReferences(module, projectFiles); + + if (withSourceCode) + { + var modulesFolderInSolution = Path.Combine(Path.GetDirectoryName(solutionFile), "modules"); + await DownloadSourceCodesToSolutionFolder(module, modulesFolderInSolution, version); + await SolutionFileModifier.AddModuleToSolutionFileAsync(module, solutionFile); + await NugetPackageToLocalReferenceConverter.Convert(module, solutionFile); + } + + ModifyDbContext(projectFiles, module, startupProject, skipDbMigrations); + } + + private async Task DownloadSourceCodesToSolutionFolder(ModuleWithMastersInfo module, string modulesFolderInSolution, string version = null) + { + await SourceCodeDownloadService.DownloadAsync( + module.Name, + Path.Combine(modulesFolderInSolution, module.Name), + version, + null, + null + ); + + if (module.MasterModuleInfos == null) + { + return; + } + + foreach (var masterModule in module.MasterModuleInfos) + { + await DownloadSourceCodesToSolutionFolder(masterModule, modulesFolderInSolution, version); + } + } + + private async Task AddNugetAndNpmReferences(ModuleWithMastersInfo module, string[] projectFiles) + { foreach (var nugetPackage in module.NugetPackages) { var targetProjectFile = ProjectFinder.FindNuGetTargetProjectFile(projectFiles, nugetPackage.Target); @@ -84,7 +132,8 @@ namespace Volo.Abp.Cli.ProjectModification foreach (var targetProject in targetProjects) { - foreach (var npmPackage in module.NpmPackages.Where(p => p.ApplicationType.HasFlag(NpmApplicationType.Mvc))) + foreach (var npmPackage in module.NpmPackages.Where(p => + p.ApplicationType.HasFlag(NpmApplicationType.Mvc))) { await ProjectNpmPackageAdder.AddAsync(Path.GetDirectoryName(targetProject), npmPackage); } @@ -95,8 +144,6 @@ namespace Volo.Abp.Cli.ProjectModification Logger.LogDebug("Target project is not available for NPM packages."); } } - - ModifyDbContext(projectFiles, module, startupProject, skipDbMigrations); } protected void ModifyDbContext(string[] projectFiles, ModuleInfo module, string startupProject, bool skipDbMigrations = false) @@ -127,20 +174,19 @@ namespace Volo.Abp.Cli.ProjectModification return; } - DbContextFileBuilderConfigureAdder.Add(dbContextFile, module.EfCoreConfigureMethodName); - + var addedNewBuilder = DbContextFileBuilderConfigureAdder.Add(dbContextFile, module.EfCoreConfigureMethodName); - if (!skipDbMigrations) + if (addedNewBuilder && !skipDbMigrations) { EfCoreMigrationAdder.AddMigration(dbMigrationsProject, module.Name, startupProject); } } - protected virtual async Task FindModuleInfoAsync(string moduleName) + protected virtual async Task FindModuleInfoAsync(string moduleName) { using (var client = new CliHttpClient()) { - var url = $"{CliUrls.WwwAbpIo}api/app/module/byName/?name=" + moduleName; + var url = $"{CliUrls.WwwAbpIo}api/app/module/byNameWithDetails/?name=" + moduleName; var response = await client.GetAsync(url); @@ -155,7 +201,7 @@ namespace Volo.Abp.Cli.ProjectModification } var responseContent = await response.Content.ReadAsStringAsync(); - return JsonSerializer.Deserialize(responseContent); + return JsonSerializer.Deserialize(responseContent); } } } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/StreamHelper.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/StreamHelper.cs new file mode 100644 index 0000000000..1f8aefe070 --- /dev/null +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/StreamHelper.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace Volo.Abp.Cli.Utils +{ + public static class StreamHelper + { + public static Stream GenerateStreamFromString(string s) + { + var stream = new MemoryStream(); + var writer = new StreamWriter(stream); + writer.Write(s); + writer.Flush(); + stream.Position = 0; + return stream; + } + } +} diff --git a/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp/FodyWeavers.xml b/framework/src/Volo.Abp.Http.Client.IdentityModel.Web/FodyWeavers.xml similarity index 100% rename from modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp/FodyWeavers.xml rename to framework/src/Volo.Abp.Http.Client.IdentityModel.Web/FodyWeavers.xml diff --git a/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp/FodyWeavers.xsd b/framework/src/Volo.Abp.Http.Client.IdentityModel.Web/FodyWeavers.xsd similarity index 100% rename from modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp/FodyWeavers.xsd rename to framework/src/Volo.Abp.Http.Client.IdentityModel.Web/FodyWeavers.xsd diff --git a/framework/src/Volo.Abp.Http.Client.IdentityModel.Web/Properties/launchSettings.json b/framework/src/Volo.Abp.Http.Client.IdentityModel.Web/Properties/launchSettings.json new file mode 100644 index 0000000000..d56e5c65b7 --- /dev/null +++ b/framework/src/Volo.Abp.Http.Client.IdentityModel.Web/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:52306/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Volo.Abp.Http.Client.IdentityModel": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "http://localhost:52307/" + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Http.Client.IdentityModel.Web/Volo.Abp.Http.Client.IdentityModel.Web.csproj b/framework/src/Volo.Abp.Http.Client.IdentityModel.Web/Volo.Abp.Http.Client.IdentityModel.Web.csproj new file mode 100644 index 0000000000..1518da9045 --- /dev/null +++ b/framework/src/Volo.Abp.Http.Client.IdentityModel.Web/Volo.Abp.Http.Client.IdentityModel.Web.csproj @@ -0,0 +1,23 @@ + + + + + + + netcoreapp3.1 + Volo.Abp.Http.Client.IdentityModel.Web + Volo.Abp.Http.Client.IdentityModel.Web + $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; + false + false + false + true + Library + + + + + + + + diff --git a/framework/src/Volo.Abp.Http.Client.IdentityModel.Web/Volo/Abp/Http/Client/IdentityModel/Web/AbpHttpClientIdentityModelWebModule.cs b/framework/src/Volo.Abp.Http.Client.IdentityModel.Web/Volo/Abp/Http/Client/IdentityModel/Web/AbpHttpClientIdentityModelWebModule.cs new file mode 100644 index 0000000000..bdb216e41c --- /dev/null +++ b/framework/src/Volo.Abp.Http.Client.IdentityModel.Web/Volo/Abp/Http/Client/IdentityModel/Web/AbpHttpClientIdentityModelWebModule.cs @@ -0,0 +1,12 @@ +using Volo.Abp.Modularity; + +namespace Volo.Abp.Http.Client.IdentityModel.Web +{ + [DependsOn( + typeof(AbpHttpClientIdentityModelModule) + )] + public class AbpHttpClientIdentityModelWebModule : AbpModule + { + + } +} diff --git a/framework/src/Volo.Abp.Http.Client.IdentityModel.Web/Volo/Abp/Http/Client/IdentityModel/Web/HttpContextIdentityModelRemoteServiceHttpClientAuthenticator.cs b/framework/src/Volo.Abp.Http.Client.IdentityModel.Web/Volo/Abp/Http/Client/IdentityModel/Web/HttpContextIdentityModelRemoteServiceHttpClientAuthenticator.cs new file mode 100644 index 0000000000..a829a630d6 --- /dev/null +++ b/framework/src/Volo.Abp.Http.Client.IdentityModel.Web/Volo/Abp/Http/Client/IdentityModel/Web/HttpContextIdentityModelRemoteServiceHttpClientAuthenticator.cs @@ -0,0 +1,48 @@ +using System.Threading.Tasks; +using IdentityModel.Client; +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Http; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Http.Client.Authentication; +using Volo.Abp.IdentityModel; + +namespace Volo.Abp.Http.Client.IdentityModel.Web +{ + [Dependency(ReplaceServices = true)] + public class HttpContextIdentityModelRemoteServiceHttpClientAuthenticator : IdentityModelRemoteServiceHttpClientAuthenticator + { + public IHttpContextAccessor HttpContextAccessor { get; set; } + + public HttpContextIdentityModelRemoteServiceHttpClientAuthenticator( + IIdentityModelAuthenticationService identityModelAuthenticationService) + : base(identityModelAuthenticationService) + { + } + + public override async Task Authenticate(RemoteServiceHttpClientAuthenticateContext context) + { + if (context.RemoteService.GetUseCurrentAccessToken() != false) + { + var accessToken = await GetAccessTokenFromHttpContextOrNullAsync(); + if (accessToken != null) + { + context.Request.SetBearerToken(accessToken); + return; + } + } + + await base.Authenticate(context); + } + + protected virtual async Task GetAccessTokenFromHttpContextOrNullAsync() + { + var httpContext = HttpContextAccessor?.HttpContext; + if (httpContext == null) + { + return null; + } + + return await httpContext.GetTokenAsync("access_token"); + } + } +} diff --git a/framework/src/Volo.Abp.Http.Client.IdentityModel/Volo.Abp.Http.Client.IdentityModel.csproj b/framework/src/Volo.Abp.Http.Client.IdentityModel/Volo.Abp.Http.Client.IdentityModel.csproj index e62293964a..d8eef1ba5d 100644 --- a/framework/src/Volo.Abp.Http.Client.IdentityModel/Volo.Abp.Http.Client.IdentityModel.csproj +++ b/framework/src/Volo.Abp.Http.Client.IdentityModel/Volo.Abp.Http.Client.IdentityModel.csproj @@ -1,18 +1,16 @@ - + - netcoreapp3.1 + netstandard2.0 Volo.Abp.Http.Client.IdentityModel Volo.Abp.Http.Client.IdentityModel $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; false false false - true - Library diff --git a/framework/src/Volo.Abp.Http.Client.IdentityModel/Volo/Abp/Http/Client/IdentityModel/IdentityModelRemoteServiceHttpClientAuthenticator.cs b/framework/src/Volo.Abp.Http.Client.IdentityModel/Volo/Abp/Http/Client/IdentityModel/IdentityModelRemoteServiceHttpClientAuthenticator.cs index 25763efbd5..0b1749f445 100644 --- a/framework/src/Volo.Abp.Http.Client.IdentityModel/Volo/Abp/Http/Client/IdentityModel/IdentityModelRemoteServiceHttpClientAuthenticator.cs +++ b/framework/src/Volo.Abp.Http.Client.IdentityModel/Volo/Abp/Http/Client/IdentityModel/IdentityModelRemoteServiceHttpClientAuthenticator.cs @@ -1,7 +1,4 @@ using System.Threading.Tasks; -using IdentityModel.Client; -using Microsoft.AspNetCore.Authentication; -using Microsoft.AspNetCore.Http; using Volo.Abp.DependencyInjection; using Volo.Abp.Http.Client.Authentication; using Volo.Abp.IdentityModel; @@ -11,8 +8,6 @@ namespace Volo.Abp.Http.Client.IdentityModel [Dependency(ReplaceServices = true)] public class IdentityModelRemoteServiceHttpClientAuthenticator : IRemoteServiceHttpClientAuthenticator, ITransientDependency { - public IHttpContextAccessor HttpContextAccessor { get; set; } - protected IIdentityModelAuthenticationService IdentityModelAuthenticationService { get; } public IdentityModelRemoteServiceHttpClientAuthenticator( @@ -21,33 +16,12 @@ namespace Volo.Abp.Http.Client.IdentityModel IdentityModelAuthenticationService = identityModelAuthenticationService; } - public async Task Authenticate(RemoteServiceHttpClientAuthenticateContext context) + public virtual async Task Authenticate(RemoteServiceHttpClientAuthenticateContext context) { - if (context.RemoteService.GetUseCurrentAccessToken() != false) - { - var accessToken = await GetAccessTokenFromHttpContextOrNullAsync(); - if (accessToken != null) - { - context.Request.SetBearerToken(accessToken); - return; - } - } - await IdentityModelAuthenticationService.TryAuthenticateAsync( context.Client, context.RemoteService.GetIdentityClient() ); } - - protected virtual async Task GetAccessTokenFromHttpContextOrNullAsync() - { - var httpContext = HttpContextAccessor?.HttpContext; - if (httpContext == null) - { - return null; - } - - return await httpContext.GetTokenAsync("access_token"); - } } } diff --git a/framework/src/Volo.Abp.Http.Client/Volo.Abp.Http.Client.csproj b/framework/src/Volo.Abp.Http.Client/Volo.Abp.Http.Client.csproj index 461a0c35f5..99f480ee63 100644 --- a/framework/src/Volo.Abp.Http.Client/Volo.Abp.Http.Client.csproj +++ b/framework/src/Volo.Abp.Http.Client/Volo.Abp.Http.Client.csproj @@ -1,18 +1,16 @@ - + - netcoreapp3.1 + netstandard2.0 Volo.Abp.Http.Client Volo.Abp.Http.Client $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; false false false - true - Library diff --git a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionFinder.cs b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionFinder.cs index 9b9c8e804c..38e6878bed 100644 --- a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionFinder.cs +++ b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionFinder.cs @@ -24,7 +24,7 @@ namespace Volo.Abp.Http.Client.DynamicProxying }; public ApiDescriptionFinder( - IApiDescriptionCache cache, + IApiDescriptionCache cache, IDynamicProxyHttpClientFactory httpClientFactory) { Cache = cache; @@ -57,7 +57,7 @@ namespace Volo.Abp.Http.Client.DynamicProxying for (int i = 0; i < methodParameters.Length; i++) { - if (action.ParametersOnMethod[i].TypeAsString != methodParameters[i].ParameterType.GetFullNameWithAssemblyName()) + if (!TypeMatches(action.ParametersOnMethod[i], methodParameters[i])) { found = false; break; @@ -104,5 +104,20 @@ namespace Volo.Abp.Http.Client.DynamicProxying return (ApplicationApiDescriptionModel)result; } } + + protected virtual bool TypeMatches(MethodParameterApiDescriptionModel actionParameter, ParameterInfo methodParameter) + { + return NormalizeTypeName(actionParameter.TypeAsString) == + NormalizeTypeName(methodParameter.ParameterType.GetFullNameWithAssemblyName()); + } + + protected virtual string NormalizeTypeName(string typeName) + { + const string placeholder = "%COREFX%"; + const string netCoreLib = "System.Private.CoreLib"; + const string netFxLib = "mscorlib"; + + return typeName.Replace(netCoreLib, placeholder).Replace(netFxLib, placeholder); + } } } diff --git a/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/AbpIdentityModelModule.cs b/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/AbpIdentityModelModule.cs index b26b545fec..d0a08707b5 100644 --- a/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/AbpIdentityModelModule.cs +++ b/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/AbpIdentityModelModule.cs @@ -13,6 +13,8 @@ namespace Volo.Abp.IdentityModel { var configuration = context.Services.GetConfiguration(); + context.Services.AddHttpClient(); + Configure(configuration); } } diff --git a/framework/src/Volo.Abp.Quartz/FodyWeavers.xml b/framework/src/Volo.Abp.Quartz/FodyWeavers.xml new file mode 100644 index 0000000000..be0de3a908 --- /dev/null +++ b/framework/src/Volo.Abp.Quartz/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.Quartz/FodyWeavers.xsd b/framework/src/Volo.Abp.Quartz/FodyWeavers.xsd new file mode 100644 index 0000000000..3f3946e282 --- /dev/null +++ b/framework/src/Volo.Abp.Quartz/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.Quartz/Volo.Abp.Quartz.csproj b/framework/src/Volo.Abp.Quartz/Volo.Abp.Quartz.csproj new file mode 100644 index 0000000000..8e29b1f803 --- /dev/null +++ b/framework/src/Volo.Abp.Quartz/Volo.Abp.Quartz.csproj @@ -0,0 +1,25 @@ + + + + + + + netstandard2.0 + Volo.Abp.Quartz + Volo.Abp.Quartz + $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; + false + false + false + + + + + + + + + + + + diff --git a/framework/src/Volo.Abp.Quartz/Volo/Abp/Quartz/AbpQuartzJobFactory.cs b/framework/src/Volo.Abp.Quartz/Volo/Abp/Quartz/AbpQuartzJobFactory.cs new file mode 100644 index 0000000000..428dbe03af --- /dev/null +++ b/framework/src/Volo.Abp.Quartz/Volo/Abp/Quartz/AbpQuartzJobFactory.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Concurrent; +using Microsoft.Extensions.DependencyInjection; +using Quartz; +using Quartz.Spi; + +namespace Volo.Abp.Quartz +{ + /// + /// Get the job from the dependency injection + /// + public class AbpQuartzJobFactory : IJobFactory + { + private readonly IServiceProvider _serviceProvider; + + private readonly ConcurrentDictionary _scopes = new ConcurrentDictionary(); + + public AbpQuartzJobFactory(IServiceProvider serviceProvider) + { + _serviceProvider = serviceProvider; + } + + public IJob NewJob(TriggerFiredBundle bundle, IScheduler scheduler) + { + var scope = _serviceProvider.CreateScope(); + var job = scope.ServiceProvider.GetRequiredService(bundle.JobDetail.JobType) as IJob; + if (job == null) + { + throw new ArgumentException("Given job does not implement IJob"); + } + _scopes.TryAdd(job, scope); + return job; + } + + public void ReturnJob(IJob job) + { + _scopes.TryRemove(job, out var serviceScope); + serviceScope?.Dispose(); + } + } +} diff --git a/framework/src/Volo.Abp.Quartz/Volo/Abp/Quartz/AbpQuartzModule.cs b/framework/src/Volo.Abp.Quartz/Volo/Abp/Quartz/AbpQuartzModule.cs new file mode 100644 index 0000000000..c16ab14f4d --- /dev/null +++ b/framework/src/Volo.Abp.Quartz/Volo/Abp/Quartz/AbpQuartzModule.cs @@ -0,0 +1,34 @@ +using Microsoft.Extensions.DependencyInjection; +using Quartz; +using Quartz.Impl; +using Quartz.Spi; +using Volo.Abp.Modularity; +using Volo.Abp.Threading; + +namespace Volo.Abp.Quartz +{ + public class AbpQuartzModule : AbpModule + { + private IScheduler _scheduler; + + public override void ConfigureServices(ServiceConfigurationContext context) + { + var options = context.Services.ExecutePreConfiguredActions(); + context.Services.AddSingleton(AsyncHelper.RunSync(() => new StdSchedulerFactory(options.Properties).GetScheduler())); + context.Services.AddSingleton(typeof(IJobFactory), typeof(AbpQuartzJobFactory)); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + _scheduler = context.ServiceProvider.GetService(); + _scheduler.JobFactory = context.ServiceProvider.GetService(); + _scheduler.Start(); + } + + public override void OnApplicationShutdown(ApplicationShutdownContext context) + { + //TODO: ABP may provide two methods for application shutdown: OnPreApplicationShutdown & OnApplicationShutdown + _scheduler.Shutdown(); + } + } +} diff --git a/framework/src/Volo.Abp.Quartz/Volo/Abp/Quartz/AbpQuartzPreOptions.cs b/framework/src/Volo.Abp.Quartz/Volo/Abp/Quartz/AbpQuartzPreOptions.cs new file mode 100644 index 0000000000..e86f993d1d --- /dev/null +++ b/framework/src/Volo.Abp.Quartz/Volo/Abp/Quartz/AbpQuartzPreOptions.cs @@ -0,0 +1,14 @@ +using System.Collections.Specialized; + +namespace Volo.Abp.Quartz +{ + public class AbpQuartzPreOptions + { + public NameValueCollection Properties { get; set; } + + public AbpQuartzPreOptions() + { + Properties = new NameValueCollection(); + } + } +} diff --git a/framework/src/Volo.Abp.Security/System/Security/Principal/AbpClaimsIdentityExtensions.cs b/framework/src/Volo.Abp.Security/System/Security/Principal/AbpClaimsIdentityExtensions.cs index 694fb7baa6..f4e4bba1a0 100644 --- a/framework/src/Volo.Abp.Security/System/Security/Principal/AbpClaimsIdentityExtensions.cs +++ b/framework/src/Volo.Abp.Security/System/Security/Principal/AbpClaimsIdentityExtensions.cs @@ -17,8 +17,11 @@ namespace System.Security.Principal { return null; } - - return Guid.Parse(userIdOrNull.Value); + if (Guid.TryParse(userIdOrNull.Value, out Guid result)) + { + return result; + } + return null; } public static Guid? FindUserId([NotNull] this IIdentity identity) diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Auditing/AuditTestController.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Auditing/AuditTestController.cs index 3c8d5dc4db..49dfef9db8 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Auditing/AuditTestController.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Auditing/AuditTestController.cs @@ -5,7 +5,6 @@ using Volo.Abp.Auditing; namespace Volo.Abp.AspNetCore.Mvc.Auditing { [Route("api/audit-test")] - [Audited] public class AuditTestController : AbpController { private readonly AbpAuditingOptions _options; diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/BasicThemeDemoMenuContributor.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/BasicThemeDemoMenuContributor.cs index 46d0467392..4cc57344e9 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/BasicThemeDemoMenuContributor.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/BasicThemeDemoMenuContributor.cs @@ -17,12 +17,61 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo private void AddMainMenuItems(MenuConfigurationContext context) { - context.Menu.AddItem( - new ApplicationMenuItem("BasicThemeDemo.Components", "Components") - .AddItem( - new ApplicationMenuItem("BasicThemeDemo.Components.Buttons", "Buttons", url: "/Components/Buttons") - ) + var menuItem = new ApplicationMenuItem("BasicThemeDemo.Components", "Components"); + menuItem.AddItem( + new ApplicationMenuItem("BasicThemeDemo.Components.Alerts", "Alerts", url: "/Components/Alerts") ); + menuItem.AddItem( + new ApplicationMenuItem("BasicThemeDemo.Components.Badges", "Badges", url: "/Components/Badges") + ); + menuItem.AddItem( + new ApplicationMenuItem("BasicThemeDemo.Components.Borders", "Borders", url: "/Components/Borders") + ); + menuItem.AddItem( + new ApplicationMenuItem("BasicThemeDemo.Components.Breadcrumbs", "Breadcrumbs", url: "/Components/Breadcrumbs") + ); + menuItem.AddItem( + new ApplicationMenuItem("BasicThemeDemo.Components.Buttons", "Buttons", url: "/Components/Buttons") + ); + menuItem.AddItem( + new ApplicationMenuItem("BasicThemeDemo.Components.Cards", "Cards", url: "/Components/Cards") + ); + menuItem.AddItem( + new ApplicationMenuItem("BasicThemeDemo.Components.Collapse", "Collapse", url: "/Components/Collapse") + ); + //menuItem.AddItem( + // new ApplicationMenuItem("BasicThemeDemo.Components.Dropdowns", "Dropdowns", url: "/Components/Dropdowns") + //); + menuItem.AddItem( + new ApplicationMenuItem("BasicThemeDemo.Components.Grids", "Grids", url: "/Components/Grids") + ); + menuItem.AddItem( + new ApplicationMenuItem("BasicThemeDemo.Components.ListGroups", "List Groups", url: "/Components/ListGroups") + ); + menuItem.AddItem( + new ApplicationMenuItem("BasicThemeDemo.Components.Modals", "Modals", url: "/Components/Modals") + ); + menuItem.AddItem( + new ApplicationMenuItem("BasicThemeDemo.Components.Navs", "Navs", url: "/Components/Navs") + ); + menuItem.AddItem( + new ApplicationMenuItem("BasicThemeDemo.Components.Popovers", "Popovers", url: "/Components/Popovers") + ); + menuItem.AddItem( + new ApplicationMenuItem("BasicThemeDemo.Components.ProgressBars", "Progress Bars", url: "/Components/ProgressBars") + ); + menuItem.AddItem( + new ApplicationMenuItem("BasicThemeDemo.Components.Tables", "Tables", url: "/Components/Tables") + ); + menuItem.AddItem( + new ApplicationMenuItem("BasicThemeDemo.Components.Tabs", "Tabs", url: "/Components/Tabs") + ); + menuItem.AddItem( + new ApplicationMenuItem("BasicThemeDemo.Components.Tooltips", "Tooltips", url: "/Components/Tooltips") + ); + + + context.Menu.AddItem(menuItem); } } } diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Alerts/Index.cshtml b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Alerts/Index.cshtml new file mode 100644 index 0000000000..d02be8912e --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Alerts/Index.cshtml @@ -0,0 +1,8 @@ +@page +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.AlertsDemo +@model Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Alerts.IndexModel + +

Alerts

+

Based on Bootstrap Alert.

+ +@await Component.InvokeAsync(typeof(AlertsDemoViewComponent)) \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Alerts/Index.cshtml.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Alerts/Index.cshtml.cs new file mode 100644 index 0000000000..1187dc021a --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Alerts/Index.cshtml.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Alerts +{ + public class IndexModel : PageModel + { + public void OnGet() + { + + } + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Badges/Index.cshtml b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Badges/Index.cshtml new file mode 100644 index 0000000000..21e8be5bcf --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Badges/Index.cshtml @@ -0,0 +1,8 @@ +@page +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.BadgesDemo +@model Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Badges.IndexModel + +

Badges

+

Based on Bootstrap Badge.

+ +@await Component.InvokeAsync(typeof(BadgesDemoViewComponent)) \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Badges/Index.cshtml.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Badges/Index.cshtml.cs new file mode 100644 index 0000000000..75067fcc35 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Badges/Index.cshtml.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Badges +{ + public class IndexModel : PageModel + { + public void OnGet() + { + + } + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Borders/Index.cshtml b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Borders/Index.cshtml new file mode 100644 index 0000000000..ce4d20f635 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Borders/Index.cshtml @@ -0,0 +1,15 @@ +@page +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.BordersDemo +@model Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Borders.IndexModel +

Borders

+

Based on Bootstrap Border.

+ +@await Component.InvokeAsync(typeof(BordersDemoViewComponent)) \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Borders/Index.cshtml.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Borders/Index.cshtml.cs new file mode 100644 index 0000000000..65ec1dc8dd --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Borders/Index.cshtml.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Borders +{ + public class IndexModel : PageModel + { + public void OnGet() + { + + } + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Breadcrumbs/Index.cshtml b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Breadcrumbs/Index.cshtml new file mode 100644 index 0000000000..380c3b1e66 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Breadcrumbs/Index.cshtml @@ -0,0 +1,7 @@ +@page +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.BreadcrumbsDemo +@model Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Breadcrumbs.IndexModel +

Breadcrumbs

+

Based on Bootstrap Breadcrumb.

+ +@await Component.InvokeAsync(typeof(BreadcrumbsDemoViewComponent)) \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Breadcrumbs/Index.cshtml.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Breadcrumbs/Index.cshtml.cs new file mode 100644 index 0000000000..e4f35e84a6 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Breadcrumbs/Index.cshtml.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Breadcrumbs +{ + public class IndexModel : PageModel + { + public void OnGet() + { + + } + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/ButtonGroups/Index.cshtml b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/ButtonGroups/Index.cshtml new file mode 100644 index 0000000000..d9f803a1bd --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/ButtonGroups/Index.cshtml @@ -0,0 +1,7 @@ +@page +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.ButtonGroupsDemo +@model Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.ButtonGroups.IndexModel +

Button Groups

+

Based on Bootstrap Button group.

+ +@await Component.InvokeAsync(typeof(ButtonGroupsDemoViewComponent)) \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/ButtonGroups/Index.cshtml.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/ButtonGroups/Index.cshtml.cs new file mode 100644 index 0000000000..fcc91c386b --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/ButtonGroups/Index.cshtml.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.ButtonGroups +{ + public class IndexModel : PageModel + { + public void OnGet() + { + + } + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Cards/Index.cshtml b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Cards/Index.cshtml new file mode 100644 index 0000000000..d0a2be5f44 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Cards/Index.cshtml @@ -0,0 +1,7 @@ +@page +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.CardsDemo +@model Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Cards.IndexModel +

Cards

+

Based on Bootstrap card.

+ +@await Component.InvokeAsync(typeof(CardsDemoViewComponent)) \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Cards/Index.cshtml.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Cards/Index.cshtml.cs new file mode 100644 index 0000000000..94761d1828 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Cards/Index.cshtml.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Cards +{ + public class IndexModel : PageModel + { + public void OnGet() + { + + } + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Collapse/Index.cshtml b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Collapse/Index.cshtml new file mode 100644 index 0000000000..5dde43970d --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Collapse/Index.cshtml @@ -0,0 +1,7 @@ +@page +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.CollapseDemo +@model Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Collapse.IndexModel +

Collapse

+

Based on Bootstrap Collapse.

+ +@await Component.InvokeAsync(typeof(CollapseDemoViewComponent)) \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Collapse/Index.cshtml.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Collapse/Index.cshtml.cs new file mode 100644 index 0000000000..afaaf65d10 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Collapse/Index.cshtml.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Collapse +{ + public class IndexModel : PageModel + { + public void OnGet() + { + + } + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Dropdowns/Index.cshtml b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Dropdowns/Index.cshtml new file mode 100644 index 0000000000..2aa853bac9 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Dropdowns/Index.cshtml @@ -0,0 +1,7 @@ +@page +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.DropdownsDemo +@model Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Dropdowns.IndexModel +

Cards

+

Based on Bootstrap button.

+ +@await Component.InvokeAsync(typeof(DropdownsDemoViewComponent)) \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Dropdowns/Index.cshtml.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Dropdowns/Index.cshtml.cs new file mode 100644 index 0000000000..6d27a631d4 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Dropdowns/Index.cshtml.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Dropdowns +{ + public class IndexModel : PageModel + { + public void OnGet() + { + + } + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Grids/Index.cshtml b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Grids/Index.cshtml new file mode 100644 index 0000000000..de80040d47 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Grids/Index.cshtml @@ -0,0 +1,7 @@ +@page +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.GridsDemo +@model Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Grids.IndexModel +

Grids

+

Based on Bootstrap grid.

+ +@await Component.InvokeAsync(typeof(GridsDemoViewComponent)) \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Grids/Index.cshtml.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Grids/Index.cshtml.cs new file mode 100644 index 0000000000..e8d829cf52 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Grids/Index.cshtml.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Grids +{ + public class IndexModel : PageModel + { + public void OnGet() + { + + } + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/ListGroups/Index.cshtml b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/ListGroups/Index.cshtml new file mode 100644 index 0000000000..64eadfa161 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/ListGroups/Index.cshtml @@ -0,0 +1,7 @@ +@page +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.ListGroupsDemo +@model Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.ListGroups.IndexModel +

List Groups

+

Based on Bootstrap List Group.

+ +@await Component.InvokeAsync(typeof(ListGroupsDemoViewComponent)) \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/ListGroups/Index.cshtml.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/ListGroups/Index.cshtml.cs new file mode 100644 index 0000000000..9f324dcbb0 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/ListGroups/Index.cshtml.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.ListGroups +{ + public class IndexModel : PageModel + { + public void OnGet() + { + + } + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Modals/Index.cshtml b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Modals/Index.cshtml new file mode 100644 index 0000000000..cec4610e76 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Modals/Index.cshtml @@ -0,0 +1,7 @@ +@page +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.ModalsDemo +@model Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Modals.IndexModel +

Modals

+

Based on Bootstrap Modal.

+ +@await Component.InvokeAsync(typeof(ModalsDemoViewComponent)) \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Modals/Index.cshtml.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Modals/Index.cshtml.cs new file mode 100644 index 0000000000..35749b0832 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Modals/Index.cshtml.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Modals +{ + public class IndexModel : PageModel + { + public void OnGet() + { + + } + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Navs/Index.cshtml b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Navs/Index.cshtml new file mode 100644 index 0000000000..3bda329ce3 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Navs/Index.cshtml @@ -0,0 +1,7 @@ +@page +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.NavsDemo +@model Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Navs.IndexModel +

Navs

+

Based on Bootstrap Navs.

+ +@await Component.InvokeAsync(typeof(NavsDemoViewComponent)) \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Navs/Index.cshtml.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Navs/Index.cshtml.cs new file mode 100644 index 0000000000..e9f901052f --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Navs/Index.cshtml.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Navs +{ + public class IndexModel : PageModel + { + public void OnGet() + { + + } + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Popovers/Index.cshtml b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Popovers/Index.cshtml new file mode 100644 index 0000000000..ebc878c511 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Popovers/Index.cshtml @@ -0,0 +1,7 @@ +@page +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.PopoversDemo +@model Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Popovers.IndexModel +

Popovers

+

Based on Bootstrap Popovers.

+ +@await Component.InvokeAsync(typeof(PopoversDemoViewComponent)) \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Popovers/Index.cshtml.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Popovers/Index.cshtml.cs new file mode 100644 index 0000000000..6bb055517b --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Popovers/Index.cshtml.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Popovers +{ + public class IndexModel : PageModel + { + public void OnGet() + { + + } + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/ProgressBars/Index.cshtml b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/ProgressBars/Index.cshtml new file mode 100644 index 0000000000..b2c51f412e --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/ProgressBars/Index.cshtml @@ -0,0 +1,7 @@ +@page +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.ProgressBarsDemo +@model Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.ProgressBars.IndexModel +

Progress Bars

+

Based on Bootstrap Progress Bars.

+ +@await Component.InvokeAsync(typeof(ProgressBarsDemoViewComponent)) \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/ProgressBars/Index.cshtml.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/ProgressBars/Index.cshtml.cs new file mode 100644 index 0000000000..e2be5ad928 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/ProgressBars/Index.cshtml.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.ProgressBars +{ + public class IndexModel : PageModel + { + public void OnGet() + { + + } + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Tables/Index.cshtml b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Tables/Index.cshtml new file mode 100644 index 0000000000..f45ccb2f47 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Tables/Index.cshtml @@ -0,0 +1,7 @@ +@page +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.TablesDemo +@model Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Tables.IndexModel +

Tables

+

Based on Bootstrap Tables.

+ +@await Component.InvokeAsync(typeof(TablesDemoViewComponent)) \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Tables/Index.cshtml.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Tables/Index.cshtml.cs new file mode 100644 index 0000000000..84289beeff --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Tables/Index.cshtml.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Tables +{ + public class IndexModel : PageModel + { + public void OnGet() + { + + } + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Tabs/Index.cshtml b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Tabs/Index.cshtml new file mode 100644 index 0000000000..7c5cff5970 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Tabs/Index.cshtml @@ -0,0 +1,7 @@ +@page +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.TabsDemo +@model Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Tabs.IndexModel +

Tabs

+

Based on Bootstrap tab.

+ +@await Component.InvokeAsync(typeof(TabsDemoViewComponent)) \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Tabs/Index.cshtml.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Tabs/Index.cshtml.cs new file mode 100644 index 0000000000..62f727d427 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Tabs/Index.cshtml.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Tabs +{ + public class IndexModel : PageModel + { + public void OnGet() + { + + } + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Tooltips/Index.cshtml b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Tooltips/Index.cshtml new file mode 100644 index 0000000000..617bb37582 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Tooltips/Index.cshtml @@ -0,0 +1,7 @@ +@page +@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo.Views.Components.Themes.Shared.Demos.TooltipsDemo +@model Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Tooltips.IndexModel +

Tooltips

+

Based on Bootstrap Tooltips.

+ +@await Component.InvokeAsync(typeof(TooltipsDemoViewComponent)) \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Tooltips/Index.cshtml.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Tooltips/Index.cshtml.cs new file mode 100644 index 0000000000..8f5170c171 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Tooltips/Index.cshtml.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Tooltips +{ + public class IndexModel : PageModel + { + public void OnGet() + { + + } + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/Auditing_Tests.cs b/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/Auditing_Tests.cs index bc41f3bcde..502ba6dcc8 100644 --- a/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/Auditing_Tests.cs +++ b/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/Auditing_Tests.cs @@ -34,8 +34,8 @@ namespace Volo.Abp.Auditing using (var scope = _auditingManager.BeginScope()) { - await myAuditedObject1.DoItAsync(new InputObject { Value1 = "forty-two", Value2 = 42 }).ConfigureAwait(false); - await scope.SaveAsync().ConfigureAwait(false); + await myAuditedObject1.DoItAsync(new InputObject { Value1 = "forty-two", Value2 = 42 }); + await scope.SaveAsync(); } #pragma warning disable 4014 @@ -80,8 +80,8 @@ namespace Volo.Abp.Auditing using (var scope = _auditingManager.BeginScope()) { var repository = ServiceProvider.GetRequiredService>(); - await repository.InsertAsync(new AppEntityWithAudited(Guid.NewGuid(), "test name")).ConfigureAwait(false); - await scope.SaveAsync().ConfigureAwait(false); + await repository.InsertAsync(new AppEntityWithAudited(Guid.NewGuid(), "test name")); + await scope.SaveAsync(); } #pragma warning disable 4014 @@ -95,8 +95,8 @@ namespace Volo.Abp.Auditing using (var scope = _auditingManager.BeginScope()) { var repository = ServiceProvider.GetRequiredService>(); - await repository.InsertAsync(new AppEntityWithAuditedAndPropertyHasDisableAuditing(Guid.NewGuid(), "test name", "test name2")).ConfigureAwait(false); - await scope.SaveAsync().ConfigureAwait(false); + await repository.InsertAsync(new AppEntityWithAuditedAndPropertyHasDisableAuditing(Guid.NewGuid(), "test name", "test name2")); + await scope.SaveAsync(); } #pragma warning disable 4014 @@ -113,12 +113,12 @@ namespace Volo.Abp.Auditing using (var scope = _auditingManager.BeginScope()) { var repository = ServiceProvider.GetRequiredService>(); - await repository.InsertAsync(new AppEntityWithDisableAuditing(Guid.NewGuid(), "test name")).ConfigureAwait(false); - await scope.SaveAsync().ConfigureAwait(false); + await repository.InsertAsync(new AppEntityWithDisableAuditing(Guid.NewGuid(), "test name")); + await scope.SaveAsync(); } #pragma warning disable 4014 - _auditingStore.DidNotReceive().SaveAsync(Arg.Any()); + _auditingStore.Received().SaveAsync(Arg.Is(a => !a.EntityChanges.Any())); #pragma warning restore 4014 } @@ -128,8 +128,8 @@ namespace Volo.Abp.Auditing using (var scope = _auditingManager.BeginScope()) { var repository = ServiceProvider.GetRequiredService>(); - await repository.InsertAsync(new AppEntityWithSelector(Guid.NewGuid(), "test name")).ConfigureAwait(false); - await scope.SaveAsync().ConfigureAwait(false); + await repository.InsertAsync(new AppEntityWithSelector(Guid.NewGuid(), "test name")); + await scope.SaveAsync(); } #pragma warning disable 4014 @@ -143,8 +143,8 @@ namespace Volo.Abp.Auditing using (var scope = _auditingManager.BeginScope()) { var repository = ServiceProvider.GetRequiredService>(); - await repository.InsertAsync(new AppEntityWithPropertyHasAudited(Guid.NewGuid(), "test name")).ConfigureAwait(false); - await scope.SaveAsync().ConfigureAwait(false); + await repository.InsertAsync(new AppEntityWithPropertyHasAudited(Guid.NewGuid(), "test name")); + await scope.SaveAsync(); } #pragma warning disable 4014 @@ -158,8 +158,8 @@ namespace Volo.Abp.Auditing using (var scope = _auditingManager.BeginScope()) { var repository = ServiceProvider.GetRequiredService>(); - await repository.InsertAsync(new AppEntityWithDisableAuditingAndPropertyHasAudited(Guid.NewGuid(), "test name", "test name2")).ConfigureAwait(false); - await scope.SaveAsync().ConfigureAwait(false); + await repository.InsertAsync(new AppEntityWithDisableAuditingAndPropertyHasAudited(Guid.NewGuid(), "test name", "test name2")); + await scope.SaveAsync(); } #pragma warning disable 4014 @@ -169,5 +169,20 @@ namespace Volo.Abp.Auditing nameof(AppEntityWithDisableAuditingAndPropertyHasAudited.Name))); #pragma warning restore 4014 } + + + [Fact] + public virtual async Task Should_Write_AuditLog_If_There_No_Action_And_No_EntityChanges() + { + using (var scope = _auditingManager.BeginScope()) + { + await scope.SaveAsync(); + } + +#pragma warning disable 4014 + _auditingStore.Received().SaveAsync(Arg.Any()); +#pragma warning restore 4014 + } + } } diff --git a/framework/test/Volo.Abp.Http.Client.IdentityModel.Web.Tests/Volo.Abp.Http.Client.IdentityModel.Web.Tests.csproj b/framework/test/Volo.Abp.Http.Client.IdentityModel.Web.Tests/Volo.Abp.Http.Client.IdentityModel.Web.Tests.csproj new file mode 100644 index 0000000000..704c3b57aa --- /dev/null +++ b/framework/test/Volo.Abp.Http.Client.IdentityModel.Web.Tests/Volo.Abp.Http.Client.IdentityModel.Web.Tests.csproj @@ -0,0 +1,16 @@ + + + + + + netcoreapp3.1 + + + + + + + + + + diff --git a/framework/test/Volo.Abp.Http.Client.IdentityModel.Web.Tests/Volo/Abp/Http/Client/IdentityModel/Web/AbpHttpClientIdentityModelWebTestModule.cs b/framework/test/Volo.Abp.Http.Client.IdentityModel.Web.Tests/Volo/Abp/Http/Client/IdentityModel/Web/AbpHttpClientIdentityModelWebTestModule.cs new file mode 100644 index 0000000000..afd46d8d1c --- /dev/null +++ b/framework/test/Volo.Abp.Http.Client.IdentityModel.Web.Tests/Volo/Abp/Http/Client/IdentityModel/Web/AbpHttpClientIdentityModelWebTestModule.cs @@ -0,0 +1,10 @@ +using Volo.Abp.Modularity; + +namespace Volo.Abp.Http.Client.IdentityModel.Web.Tests +{ + [DependsOn(typeof(AbpHttpClientIdentityModelWebModule))] + public class AbpHttpClientIdentityModelWebTestModule : AbpModule + { + + } +} diff --git a/framework/test/Volo.Abp.Http.Client.IdentityModel.Web.Tests/Volo/Abp/Http/Client/IdentityModel/Web/HttpContextIdentityModelRemoteServiceHttpClientAuthenticator_Tests.cs b/framework/test/Volo.Abp.Http.Client.IdentityModel.Web.Tests/Volo/Abp/Http/Client/IdentityModel/Web/HttpContextIdentityModelRemoteServiceHttpClientAuthenticator_Tests.cs new file mode 100644 index 0000000000..63da9ae62a --- /dev/null +++ b/framework/test/Volo.Abp.Http.Client.IdentityModel.Web.Tests/Volo/Abp/Http/Client/IdentityModel/Web/HttpContextIdentityModelRemoteServiceHttpClientAuthenticator_Tests.cs @@ -0,0 +1,26 @@ +using Shouldly; +using Volo.Abp.DynamicProxy; +using Volo.Abp.Http.Client.Authentication; +using Volo.Abp.Http.Client.IdentityModel.Web.Tests; +using Volo.Abp.Testing; +using Xunit; + +namespace Volo.Abp.Http.Client.IdentityModel.Web +{ + public class HttpContextIdentityModelRemoteServiceHttpClientAuthenticator_Tests : AbpIntegratedTest + { + private readonly IRemoteServiceHttpClientAuthenticator _remoteServiceHttpClientAuthenticator; + + public HttpContextIdentityModelRemoteServiceHttpClientAuthenticator_Tests() + { + _remoteServiceHttpClientAuthenticator = GetRequiredService(); + } + + [Fact] + public void Implementation_Should_Be_Type_Of_HttpContextIdentityModelRemoteServiceHttpClientAuthenticator() + { + ProxyHelper.UnProxy(_remoteServiceHttpClientAuthenticator) + .ShouldBeOfType(typeof(HttpContextIdentityModelRemoteServiceHttpClientAuthenticator)); + } + } +} diff --git a/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AccountAppService.cs b/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AccountAppService.cs index 695d9b233f..31de74efde 100644 --- a/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AccountAppService.cs +++ b/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AccountAppService.cs @@ -29,7 +29,7 @@ namespace Volo.Abp.Account (await UserManager.CreateAsync(user, input.Password)).CheckErrors(); - await UserManager.SetEmailAsync(user,input.EmailAddress).ConfigureAwait(false); + await UserManager.SetEmailAsync(user,input.EmailAddress); await SetDefaultRolesAsync(user); @@ -38,9 +38,9 @@ namespace Volo.Abp.Account protected virtual async Task SetDefaultRolesAsync(IdentityUser user) { - var defaultRoles = await _roleRepository.GetDefaultOnesAsync().ConfigureAwait(false); + var defaultRoles = await _roleRepository.GetDefaultOnesAsync(); - await UserManager.SetRolesAsync(user, defaultRoles.Select(r => r.Name)).ConfigureAwait(false); + await UserManager.SetRolesAsync(user, defaultRoles.Select(r => r.Name)); } protected virtual async Task CheckSelfRegistrationAsync() diff --git a/modules/account/src/Volo.Abp.Account.HttpApi.Client/Volo.Abp.Account.HttpApi.Client.csproj b/modules/account/src/Volo.Abp.Account.HttpApi.Client/Volo.Abp.Account.HttpApi.Client.csproj index 89679b3e22..aef884dbe2 100644 --- a/modules/account/src/Volo.Abp.Account.HttpApi.Client/Volo.Abp.Account.HttpApi.Client.csproj +++ b/modules/account/src/Volo.Abp.Account.HttpApi.Client/Volo.Abp.Account.HttpApi.Client.csproj @@ -4,7 +4,7 @@ - netcoreapp3.1 + netstandard2.0 Volo.Abp.Account.HttpApi.Client Volo.Abp.Account.HttpApi.Client diff --git a/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Consent.cshtml b/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Consent.cshtml index fa3efda621..b61ad00152 100644 --- a/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Consent.cshtml +++ b/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Consent.cshtml @@ -1,4 +1,4 @@ -@page +@page @using Volo.Abp.Account.Web.Pages @using Volo.Abp.Account.Web.Pages.Account @model ConsentModel @@ -25,7 +25,7 @@
Uncheck the permissions you do not wish to grant.
- @if (Model.ConsentInput.IdentityScopes.Any()) + @if (!Model.ConsentInput.IdentityScopes.IsNullOrEmpty()) {

Personal Information

@@ -55,7 +55,7 @@ } - @if (Model.ConsentInput.ApiScopes.Any()) + @if (!Model.ConsentInput.ApiScopes.IsNullOrEmpty()) {

Application Access

diff --git a/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Consent.cshtml.cs b/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Consent.cshtml.cs index 3fb68feaca..2df177b620 100644 --- a/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Consent.cshtml.cs +++ b/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Consent.cshtml.cs @@ -106,7 +106,7 @@ namespace Volo.Abp.Account.Web.Pages } else { - if (ConsentInput.IdentityScopes.Any() || ConsentInput.ApiScopes.Any()) + if (!ConsentInput.IdentityScopes.IsNullOrEmpty() || !ConsentInput.ApiScopes.IsNullOrEmpty()) { grantedConsent = new ConsentResponse { @@ -187,7 +187,9 @@ namespace Volo.Abp.Account.Web.Pages public List GetAllowedScopeNames() { - return IdentityScopes.Union(ApiScopes).Where(s => s.Checked).Select(s => s.Name).ToList(); + var identityScopes = IdentityScopes ?? new List(); + var apiScopes = IdentityScopes ?? new List(); + return identityScopes.Union(apiScopes).Where(s => s.Checked).Select(s => s.Name).ToList(); } } diff --git a/modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/AccountController.cs b/modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/AccountController.cs index 48b8da5c38..d916368c39 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/AccountController.cs +++ b/modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/AccountController.cs @@ -145,7 +145,7 @@ namespace Volo.Abp.Account.Web.Areas.Account.Controllers private async Task CheckLocalLoginAsync() { - if (!await _settingProvider.IsTrueAsync(AccountSettingNames.EnableLocalLogin).ConfigureAwait(false)) + if (!await _settingProvider.IsTrueAsync(AccountSettingNames.EnableLocalLogin)) { throw new UserFriendlyException(L["LocalLoginDisabledMessage"]); } diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs index 53954fd9e4..7857537acb 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs @@ -240,7 +240,7 @@ namespace Volo.Abp.Account.Web.Pages.Account protected virtual async Task CheckLocalLoginAsync() { - if (!await SettingProvider.IsTrueAsync(AccountSettingNames.EnableLocalLogin).ConfigureAwait(false)) + if (!await SettingProvider.IsTrueAsync(AccountSettingNames.EnableLocalLogin)) { throw new UserFriendlyException(L["LocalLoginDisabledMessage"]); } diff --git a/modules/background-jobs/Volo.Abp.BackgroundJobs.sln b/modules/background-jobs/Volo.Abp.BackgroundJobs.sln index 09bfc90457..83263fa296 100644 --- a/modules/background-jobs/Volo.Abp.BackgroundJobs.sln +++ b/modules/background-jobs/Volo.Abp.BackgroundJobs.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27703.2026 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29519.87 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.BackgroundJobs.Domain.Shared", "src\Volo.Abp.BackgroundJobs.Domain.Shared\Volo.Abp.BackgroundJobs.Domain.Shared.csproj", "{D64C1577-4929-4B60-939E-96DE1534891A}" EndProject @@ -27,11 +27,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.BackgroundJobs.Mon EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.BackgroundJobs.DemoApp", "app\Volo.Abp.BackgroundJobs.DemoApp\Volo.Abp.BackgroundJobs.DemoApp.csproj", "{9A871D66-BE8D-440C-BF79-F778F8A50BF3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.BackgroundJobs.DemoApp.Shared", "app\Volo.Abp.BackgroundJobs.DemoApp.Shared\Volo.Abp.BackgroundJobs.DemoApp.Shared.csproj", "{DE6914FF-F60A-461A-8498-461198E917BE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.BackgroundJobs.DemoApp.Shared", "app\Volo.Abp.BackgroundJobs.DemoApp.Shared\Volo.Abp.BackgroundJobs.DemoApp.Shared.csproj", "{DE6914FF-F60A-461A-8498-461198E917BE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.BackgroundJobs.DemoApp.HangFire", "app\Volo.Abp.BackgroundJobs.DemoApp.HangFire\Volo.Abp.BackgroundJobs.DemoApp.HangFire.csproj", "{2060AC85-2598-4342-A87C-A684A2C71A37}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.BackgroundJobs.DemoApp.HangFire", "app\Volo.Abp.BackgroundJobs.DemoApp.HangFire\Volo.Abp.BackgroundJobs.DemoApp.HangFire.csproj", "{2060AC85-2598-4342-A87C-A684A2C71A37}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.BackgroundJobs.DemoApp.RabbitMq", "app\Volo.Abp.BackgroundJobs.DemoApp.RabbitMq\Volo.Abp.BackgroundJobs.DemoApp.RabbitMq.csproj", "{7C8D03F7-165E-478C-A6D6-DC8229EEABB9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.BackgroundJobs.DemoApp.RabbitMq", "app\Volo.Abp.BackgroundJobs.DemoApp.RabbitMq\Volo.Abp.BackgroundJobs.DemoApp.RabbitMq.csproj", "{7C8D03F7-165E-478C-A6D6-DC8229EEABB9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.BackgroundJobs.DemoApp.Quartz", "app\Volo.Abp.BackgroundJobs.DemoApp.Quartz\Volo.Abp.BackgroundJobs.DemoApp.Quartz.csproj", "{0146891D-3FF8-4516-94D6-B9EFC37383CD}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -87,6 +89,10 @@ Global {7C8D03F7-165E-478C-A6D6-DC8229EEABB9}.Debug|Any CPU.Build.0 = Debug|Any CPU {7C8D03F7-165E-478C-A6D6-DC8229EEABB9}.Release|Any CPU.ActiveCfg = Release|Any CPU {7C8D03F7-165E-478C-A6D6-DC8229EEABB9}.Release|Any CPU.Build.0 = Release|Any CPU + {0146891D-3FF8-4516-94D6-B9EFC37383CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0146891D-3FF8-4516-94D6-B9EFC37383CD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0146891D-3FF8-4516-94D6-B9EFC37383CD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0146891D-3FF8-4516-94D6-B9EFC37383CD}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -104,6 +110,7 @@ Global {DE6914FF-F60A-461A-8498-461198E917BE} = {E400416D-2895-4512-9D17-90681EEC7E0A} {2060AC85-2598-4342-A87C-A684A2C71A37} = {E400416D-2895-4512-9D17-90681EEC7E0A} {7C8D03F7-165E-478C-A6D6-DC8229EEABB9} = {E400416D-2895-4512-9D17-90681EEC7E0A} + {0146891D-3FF8-4516-94D6-B9EFC37383CD} = {E400416D-2895-4512-9D17-90681EEC7E0A} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4324B3B4-B60B-4E3C-91D8-59576B4E26DD} diff --git a/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.HangFire/Volo.Abp.BackgroundJobs.DemoApp.HangFire.csproj b/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.HangFire/Volo.Abp.BackgroundJobs.DemoApp.HangFire.csproj index f27272bd28..3490b31f67 100644 --- a/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.HangFire/Volo.Abp.BackgroundJobs.DemoApp.HangFire.csproj +++ b/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.HangFire/Volo.Abp.BackgroundJobs.DemoApp.HangFire.csproj @@ -1,6 +1,4 @@ - - - + Exe diff --git a/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.Quartz/DemoAppQuartzModule.cs b/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.Quartz/DemoAppQuartzModule.cs new file mode 100644 index 0000000000..76c8815a9f --- /dev/null +++ b/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.Quartz/DemoAppQuartzModule.cs @@ -0,0 +1,28 @@ +using System.Collections.Specialized; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Autofac; +using Volo.Abp.BackgroundJobs.DemoApp.Shared; +using Volo.Abp.BackgroundJobs.Quartz; +using Volo.Abp.Modularity; +using Volo.Abp.Quartz; + +namespace Volo.Abp.BackgroundJobs.DemoApp.Quartz +{ + [DependsOn( + typeof(DemoAppSharedModule), + typeof(AbpAutofacModule), + typeof(AbpBackgroundJobsQuartzModule) + )] + public class DemoAppQuartzModule : AbpModule + { + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + //TODO: Configure console logging + //context + // .ServiceProvider + // .GetRequiredService() + // .AddConsole(LogLevel.Debug); + } + } +} diff --git a/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.Quartz/Program.cs b/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.Quartz/Program.cs new file mode 100644 index 0000000000..9efe5e4350 --- /dev/null +++ b/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.Quartz/Program.cs @@ -0,0 +1,24 @@ +using System; + +namespace Volo.Abp.BackgroundJobs.DemoApp.Quartz +{ + class Program + { + static void Main(string[] args) + { + using (var application = AbpApplicationFactory.Create(options => + { + options.UseAutofac(); + })) + { + application.Initialize(); + + Console.WriteLine("Started: " + typeof(Program).Namespace); + Console.WriteLine("Press ENTER to stop the application..!"); + Console.ReadLine(); + + application.Shutdown(); + } + } + } +} diff --git a/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.Quartz/Volo.Abp.BackgroundJobs.DemoApp.Quartz.csproj b/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.Quartz/Volo.Abp.BackgroundJobs.DemoApp.Quartz.csproj new file mode 100644 index 0000000000..7bd70093ee --- /dev/null +++ b/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.Quartz/Volo.Abp.BackgroundJobs.DemoApp.Quartz.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp3.1 + + + + + + + + + + + + + diff --git a/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.RabbitMq/Volo.Abp.BackgroundJobs.DemoApp.RabbitMq.csproj b/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.RabbitMq/Volo.Abp.BackgroundJobs.DemoApp.RabbitMq.csproj index 460716fb26..adcf9be1aa 100644 --- a/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.RabbitMq/Volo.Abp.BackgroundJobs.DemoApp.RabbitMq.csproj +++ b/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.RabbitMq/Volo.Abp.BackgroundJobs.DemoApp.RabbitMq.csproj @@ -1,6 +1,4 @@ - - - + Exe diff --git a/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp/Volo.Abp.BackgroundJobs.DemoApp.csproj b/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp/Volo.Abp.BackgroundJobs.DemoApp.csproj index 6c9c118af4..b3bc53a2ed 100644 --- a/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp/Volo.Abp.BackgroundJobs.DemoApp.csproj +++ b/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp/Volo.Abp.BackgroundJobs.DemoApp.csproj @@ -1,6 +1,4 @@ - - - + Exe diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/IPostAppService.cs b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/IPostAppService.cs index aee0a26a23..55b64d29de 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/IPostAppService.cs +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/IPostAppService.cs @@ -9,6 +9,8 @@ namespace Volo.Blogging.Posts { Task> GetListByBlogIdAndTagName(Guid blogId, string tagName); + Task> GetTimeOrderedListAsync(Guid blogId); + Task GetForReadingAsync(GetPostInput input); Task GetAsync(Guid id); diff --git a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs index d798814caa..44b8e9866e 100644 --- a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs +++ b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs @@ -44,11 +44,6 @@ namespace Volo.Blogging.Posts postDtos = await FilterPostsByTag(postDtos, tag); } - foreach (var postDto in postDtos) - { - postDto.CommentCount = await _commentRepository.GetCommentCountOfPostAsync(postDto.Id); - } - foreach (var postDto in postDtos) { if (postDto.CreatorId.HasValue) @@ -72,6 +67,24 @@ namespace Volo.Blogging.Posts return new ListResultDto(postDtos); } + public async Task> GetTimeOrderedListAsync(Guid blogId) + { + var posts = await _postRepository.GetOrderedList(blogId); + + var postDtos = new List(ObjectMapper.Map, List>(posts)); + + foreach (var postDto in postDtos) + { + var creatorUser = await UserLookupService.FindByIdAsync(postDto.CreatorId.Value); + if (creatorUser != null) + { + postDto.Writer = ObjectMapper.Map(creatorUser); + } + } + + return new ListResultDto(postDtos); + } + public async Task GetForReadingAsync(GetPostInput input) { var post = await _postRepository.GetPostByUrl(input.BlogId, input.Url); @@ -172,7 +185,7 @@ namespace Volo.Blogging.Posts { var postList = await _postRepository.GetListAsync(); - if (postList.Where(p => p.Url == url).WhereIf(existingPost != null, p => existingPost.Id != p.Id).Any()) + if (postList.Where(p => p.Url == url).WhereIf(existingPost != null, p => existingPost.Id != p.Id).Any()) { return url + "-" + Guid.NewGuid().ToString().Substring(0, 5); } @@ -252,7 +265,7 @@ namespace Volo.Blogging.Posts private Task> FilterPostsByTag(IEnumerable allPostDtos, Tag tag) { var filteredPostDtos = allPostDtos.Where(p => p.Tags?.Any(t => t.Id == tag.Id) ?? false).ToList(); - + return Task.FromResult(filteredPostDtos); } } diff --git a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Posts/IPostRepository.cs b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Posts/IPostRepository.cs index d38cd5c0d7..02bd68a6b0 100644 --- a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Posts/IPostRepository.cs +++ b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Posts/IPostRepository.cs @@ -10,5 +10,7 @@ namespace Volo.Blogging.Posts Task> GetPostsByBlogId(Guid id); Task GetPostByUrl(Guid blogId, string url); + + Task> GetOrderedList(Guid blogId,bool descending = false); } } diff --git a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/Posts/EfCorePostRepository.cs b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/Posts/EfCorePostRepository.cs index fd4bec2de4..01c5652902 100644 --- a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/Posts/EfCorePostRepository.cs +++ b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/Posts/EfCorePostRepository.cs @@ -35,6 +35,19 @@ namespace Volo.Blogging.Posts return post; } + public async Task> GetOrderedList(Guid blogId,bool descending = false) + { + if (!descending) + { + return await DbSet.Where(x=>x.BlogId==blogId).OrderByDescending(x => x.CreationTime).ToListAsync(); + } + else + { + return await DbSet.Where(x => x.BlogId == blogId).OrderBy(x => x.CreationTime).ToListAsync(); + } + + } + public override IQueryable WithDetails() { return GetQueryable().IncludeDetails(); diff --git a/modules/blogging/src/Volo.Blogging.HttpApi.Client/Volo.Blogging.HttpApi.Client.csproj b/modules/blogging/src/Volo.Blogging.HttpApi.Client/Volo.Blogging.HttpApi.Client.csproj index 754382f89c..68b3775baa 100644 --- a/modules/blogging/src/Volo.Blogging.HttpApi.Client/Volo.Blogging.HttpApi.Client.csproj +++ b/modules/blogging/src/Volo.Blogging.HttpApi.Client/Volo.Blogging.HttpApi.Client.csproj @@ -4,7 +4,7 @@ - netcoreapp3.1 + netstandard2.0 Volo.Blogging.HttpApi.Client Volo.Blogging.HttpApi.Client diff --git a/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/PostsController.cs b/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/PostsController.cs index 79e7d920f8..332f60c256 100644 --- a/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/PostsController.cs +++ b/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/PostsController.cs @@ -27,6 +27,13 @@ namespace Volo.Blogging return _postAppService.GetListByBlogIdAndTagName(blogId, tagName); } + [HttpGet] + [Route("{blogId}/all/by-time")] + public Task> GetTimeOrderedListAsync(Guid blogId) + { + return _postAppService.GetTimeOrderedListAsync(blogId); + } + [HttpGet] [Route("read")] public Task GetForReadingAsync(GetPostInput input) @@ -60,5 +67,6 @@ namespace Volo.Blogging { return _postAppService.DeleteAsync(id); } + } } diff --git a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Posts/MongoPostRepository.cs b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Posts/MongoPostRepository.cs index 52a614df90..2e7675a898 100644 --- a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Posts/MongoPostRepository.cs +++ b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Posts/MongoPostRepository.cs @@ -32,5 +32,17 @@ namespace Volo.Blogging.Posts return post; } + + public async Task> GetOrderedList(Guid blogId, bool @descending = false) + { + var query = GetMongoQueryable().Where(x => x.BlogId == blogId); + + if (!descending) + { + return await query.OrderBy(x => x.CreationTime).ToListAsync(); + } + + return await query.OrderByDescending(x => x.CreationTime).ToListAsync(); + } } } diff --git a/modules/client-simulation/src/Volo.ClientSimulation.Web/ClientSimulationWebModule.cs b/modules/client-simulation/src/Volo.ClientSimulation.Web/ClientSimulationWebModule.cs index c75ee14656..8cdc7809ab 100644 --- a/modules/client-simulation/src/Volo.ClientSimulation.Web/ClientSimulationWebModule.cs +++ b/modules/client-simulation/src/Volo.ClientSimulation.Web/ClientSimulationWebModule.cs @@ -1,4 +1,5 @@ using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; +using Volo.Abp.Http.Client.IdentityModel.Web; using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; @@ -6,6 +7,7 @@ namespace Volo.ClientSimulation { [DependsOn( typeof(ClientSimulationModule), + typeof(AbpHttpClientIdentityModelWebModule), typeof(AbpAspNetCoreMvcUiThemeSharedModule) )] public class ClientSimulationWebModule : AbpModule diff --git a/modules/client-simulation/src/Volo.ClientSimulation.Web/Volo.ClientSimulation.Web.csproj b/modules/client-simulation/src/Volo.ClientSimulation.Web/Volo.ClientSimulation.Web.csproj index ad0ce496f5..57b87b9e72 100644 --- a/modules/client-simulation/src/Volo.ClientSimulation.Web/Volo.ClientSimulation.Web.csproj +++ b/modules/client-simulation/src/Volo.ClientSimulation.Web/Volo.ClientSimulation.Web.csproj @@ -15,6 +15,7 @@ + diff --git a/modules/docs/src/Volo.Docs.HttpApi.Client/Volo.Docs.HttpApi.Client.csproj b/modules/docs/src/Volo.Docs.HttpApi.Client/Volo.Docs.HttpApi.Client.csproj index f527001c45..5df5515e32 100644 --- a/modules/docs/src/Volo.Docs.HttpApi.Client/Volo.Docs.HttpApi.Client.csproj +++ b/modules/docs/src/Volo.Docs.HttpApi.Client/Volo.Docs.HttpApi.Client.csproj @@ -4,7 +4,7 @@ - netcoreapp3.1 + netstandard2.0 Volo.Docs.HttpApi.Client Volo.Docs.HttpApi.Client diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml index 5d973cf16f..e029f2685e 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml @@ -29,7 +29,7 @@ {
  • - + @project.Name

    diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs index 9e21ec22de..50db79cb43 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs @@ -33,7 +33,7 @@ namespace Volo.Docs.Pages.Documents if (listResult.Items.Count == 1) { - return Redirect("." + DocumentsUrlPrefix + listResult.Items[0].ShortName); + return Redirect(DocumentsUrlPrefix + listResult.Items[0].ShortName); } Projects = listResult.Items; diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.HttpApi.Client/Volo.Abp.FeatureManagement.HttpApi.Client.csproj b/modules/feature-management/src/Volo.Abp.FeatureManagement.HttpApi.Client/Volo.Abp.FeatureManagement.HttpApi.Client.csproj index 1a784f6e6c..a6dd5772e8 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.HttpApi.Client/Volo.Abp.FeatureManagement.HttpApi.Client.csproj +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.HttpApi.Client/Volo.Abp.FeatureManagement.HttpApi.Client.csproj @@ -4,7 +4,7 @@ - netcoreapp3.1 + netstandard2.0 diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/Volo.Abp.Identity.HttpApi.Client.csproj b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/Volo.Abp.Identity.HttpApi.Client.csproj index 11fd0a40b6..5bff2432a7 100644 --- a/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/Volo.Abp.Identity.HttpApi.Client.csproj +++ b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/Volo.Abp.Identity.HttpApi.Client.csproj @@ -1,18 +1,16 @@ - + - netcoreapp3.1 + netstandard2.0 Volo.Abp.Identity.HttpApi.Client Volo.Abp.Identity.HttpApi.Client $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; false false false - Library - true diff --git a/modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/IdentityRoleRepository_Tests.cs b/modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/IdentityRoleRepository_Tests.cs index eb22de0600..1f65dd821f 100644 --- a/modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/IdentityRoleRepository_Tests.cs +++ b/modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/IdentityRoleRepository_Tests.cs @@ -39,7 +39,7 @@ namespace Volo.Abp.Identity [Fact] public async Task GetDefaultOnesAsync() { - var roles = await RoleRepository.GetDefaultOnesAsync().ConfigureAwait(false); + var roles = await RoleRepository.GetDefaultOnesAsync(); foreach (var role in roles) { diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Localization/Resources/en.json b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Localization/Resources/en.json index 6b2757a963..f974297b06 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Localization/Resources/en.json +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Localization/Resources/en.json @@ -3,6 +3,10 @@ "texts": { "Volo.IdentityServer:DuplicateIdentityResourceName": "Identity Resource name already exist: {Name}", "Volo.IdentityServer:DuplicateApiResourceName": "Api Resource name already exist: {Name}", - "Volo.IdentityServer:DuplicateClientId": "ClientId already exist: {ClientId}" + "Volo.IdentityServer:DuplicateClientId": "ClientId already exist: {ClientId}", + "UserLockedOut": "The user account has been locked out due to invalid login attempts. Please wait a while and try again.", + "InvalidUserNameOrPassword": "Invalid username or password!", + "LoginIsNotAllowed": "You are not allowed to login! You need to confirm your email/phone number.", + "InvalidUsername": "Invalid username or password!" } } \ No newline at end of file diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Localization/Resources/tr.json b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Localization/Resources/tr.json index 9340b7999f..60f7a75a77 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Localization/Resources/tr.json +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Localization/Resources/tr.json @@ -3,6 +3,10 @@ "texts": { "Volo.IdentityServer:DuplicateIdentityResourceName": "Identity Resource adı zaten mevcut: {Name}", "Volo.IdentityServer:DuplicateApiResourceName": "Api Resource adı zaten mevcut: {Name}", - "Volo.IdentityServer:DuplicateClientId": "ClientId already zaten mevcut: {ClientId}" + "Volo.IdentityServer:DuplicateClientId": "ClientId already zaten mevcut: {ClientId}", + "UserLockedOut": "Kullanıcı hesabı hatalı giriş denemeleri nedeniyle kilitlenmiştir. Lütfen bir süre bekleyip tekrar deneyin.", + "InvalidUserNameOrPassword": "Kullanıcı adı ya da şifre geçersiz!", + "LoginIsNotAllowed": "Giriş yapamazsınız! E-posta adresinizi ya da telefon numaranızı doğrulamanız gerekiyor.", + "InvalidUsername": "Kullanıcı adı ya da şifre geçersiz!" } } \ No newline at end of file diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Localization/Resources/zh-Hans.json b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Localization/Resources/zh-Hans.json index b2d186e8b4..ac175e574d 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Localization/Resources/zh-Hans.json +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Localization/Resources/zh-Hans.json @@ -3,6 +3,10 @@ "texts": { "Volo.IdentityServer:DuplicateIdentityResourceName": "Identity资源名称已存在: {Name}", "Volo.IdentityServer:DuplicateApiResourceName": "Api资源名称已存在: {Name}", - "Volo.IdentityServer:DuplicateClientId": "ClientId已经存在: {ClientId}" + "Volo.IdentityServer:DuplicateClientId": "ClientId已经存在: {ClientId}", + "UserLockedOut": "登录失败,用户账户已被锁定.请稍后再试.", + "InvalidUserNameOrPassword": "用户名或密码错误!", + "LoginIsNotAllowed": "无法登录!你需要验证邮箱地址/手机号.", + "InvalidUsername": "用户名或密码错误!" } } \ No newline at end of file diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Localization/Resources/zh-Hant.json b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Localization/Resources/zh-Hant.json index 859e8c29b7..0ffeae8f81 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Localization/Resources/zh-Hant.json +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Localization/Resources/zh-Hant.json @@ -3,6 +3,10 @@ "texts": { "Volo.IdentityServer:DuplicateIdentityResourceName": "Identity資源名稱已存在: {Name}", "Volo.IdentityServer:DuplicateApiResourceName": "Api資源名稱已存在: {Name}", - "Volo.IdentityServer:DuplicateClientId": "ClientId已經存在: {ClientId}" + "Volo.IdentityServer:DuplicateClientId": "ClientId已經存在: {ClientId}", + "UserLockedOut": "登錄失敗,用戶賬戶已被鎖定.請稍後再試.", + "InvalidUserNameOrPassword": "用戶名或密碼錯誤!", + "LoginIsNotAllowed": "無法登錄!妳需要驗證郵箱地址/手機號.", + "InvalidUsername": "用戶名或密碼錯誤!" } } \ No newline at end of file diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AspNetIdentity/AbpResourceOwnerPasswordValidator.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AspNetIdentity/AbpResourceOwnerPasswordValidator.cs index 68489a1bdb..ce11a167e1 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AspNetIdentity/AbpResourceOwnerPasswordValidator.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AspNetIdentity/AbpResourceOwnerPasswordValidator.cs @@ -8,7 +8,9 @@ using IdentityServer4.Models; using IdentityServer4.Services; using IdentityServer4.Validation; using Microsoft.AspNetCore.Identity; +using Microsoft.Extensions.Localization; using Microsoft.Extensions.Logging; +using Volo.Abp.IdentityServer.Localization; using Volo.Abp.Security.Claims; using Volo.Abp.Uow; using Volo.Abp.Validation; @@ -22,17 +24,20 @@ namespace Volo.Abp.IdentityServer.AspNetIdentity private readonly IEventService _events; private readonly UserManager _userManager; private readonly ILogger> _logger; + private readonly IStringLocalizer _localizer; public AbpResourceOwnerPasswordValidator( UserManager userManager, SignInManager signInManager, IEventService events, - ILogger> logger) + ILogger> logger, + IStringLocalizer localizer) { _userManager = userManager; _signInManager = signInManager; _events = events; _logger = logger; + _localizer = localizer; } /// @@ -44,8 +49,8 @@ namespace Volo.Abp.IdentityServer.AspNetIdentity public virtual async Task ValidateAsync(ResourceOwnerPasswordValidationContext context) { await ReplaceEmailToUsernameOfInputIfNeeds(context); - var user = await _userManager.FindByNameAsync(context.UserName); + string errorDescription; if (user != null) { var result = await _signInManager.CheckPasswordSignInAsync(user, context.Password, true); @@ -72,25 +77,29 @@ namespace Volo.Abp.IdentityServer.AspNetIdentity { _logger.LogInformation("Authentication failed for username: {username}, reason: locked out", context.UserName); await _events.RaiseAsync(new UserLoginFailureEvent(context.UserName, "locked out", interactive: false)); + errorDescription = _localizer["UserLockedOut"]; } else if (result.IsNotAllowed) { _logger.LogInformation("Authentication failed for username: {username}, reason: not allowed", context.UserName); await _events.RaiseAsync(new UserLoginFailureEvent(context.UserName, "not allowed", interactive: false)); + errorDescription = _localizer["LoginIsNotAllowed"]; } else { _logger.LogInformation("Authentication failed for username: {username}, reason: invalid credentials", context.UserName); await _events.RaiseAsync(new UserLoginFailureEvent(context.UserName, "invalid credentials", interactive: false)); + errorDescription = _localizer["InvalidUserNameOrPassword"]; } } else { _logger.LogInformation("No user found matching username: {username}", context.UserName); await _events.RaiseAsync(new UserLoginFailureEvent(context.UserName, "invalid username", interactive: false)); + errorDescription = _localizer["InvalidUsername"]; } - context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant); + context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant, errorDescription); } protected virtual async Task ReplaceEmailToUsernameOfInputIfNeeds(ResourceOwnerPasswordValidationContext context) diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.HttpApi.Client/Volo.Abp.PermissionManagement.HttpApi.Client.csproj b/modules/permission-management/src/Volo.Abp.PermissionManagement.HttpApi.Client/Volo.Abp.PermissionManagement.HttpApi.Client.csproj index 8360442b75..a198deb9eb 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.HttpApi.Client/Volo.Abp.PermissionManagement.HttpApi.Client.csproj +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.HttpApi.Client/Volo.Abp.PermissionManagement.HttpApi.Client.csproj @@ -4,7 +4,7 @@ - netcoreapp3.1 + netstandard2.0 Volo.Abp.PermissionManagement.HttpApi.Client Volo.Abp.PermissionManagement.HttpApi.Client $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.HttpApi.Client/Volo.Abp.TenantManagement.HttpApi.Client.csproj b/modules/tenant-management/src/Volo.Abp.TenantManagement.HttpApi.Client/Volo.Abp.TenantManagement.HttpApi.Client.csproj index 9c36b1b29e..263d7b4048 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.HttpApi.Client/Volo.Abp.TenantManagement.HttpApi.Client.csproj +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.HttpApi.Client/Volo.Abp.TenantManagement.HttpApi.Client.csproj @@ -4,7 +4,7 @@ - netcoreapp3.1 + netstandard2.0 Volo.Abp.TenantManagement.HttpApi.Client Volo.Abp.TenantManagement.HttpApi.Client $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; diff --git a/nupkg/common.ps1 b/nupkg/common.ps1 index a582f8c115..52c2a54464 100644 --- a/nupkg/common.ps1 +++ b/nupkg/common.ps1 @@ -50,7 +50,9 @@ $projects = ( "framework/src/Volo.Abp.BackgroundJobs", "framework/src/Volo.Abp.BackgroundJobs.HangFire", "framework/src/Volo.Abp.BackgroundJobs.RabbitMQ", + "framework/src/Volo.Abp.BackgroundJobs.Quartz", "framework/src/Volo.Abp.BackgroundWorkers", + "framework/src/Volo.Abp.BackgroundWorkers.Quartz", "framework/src/Volo.Abp.Caching", "framework/src/Volo.Abp.Castle.Core", "framework/src/Volo.Abp.Cli.Core", @@ -79,6 +81,7 @@ $projects = ( "framework/src/Volo.Abp.Http.Client.IdentityModel", "framework/src/Volo.Abp.Http", "framework/src/Volo.Abp.IdentityModel", + "framework/src/Volo.Abp.IdentityModel.Web", "framework/src/Volo.Abp.Json", "framework/src/Volo.Abp.Ldap", "framework/src/Volo.Abp.Localization.Abstractions", diff --git a/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.HttpApi.Client.ConsoleTestApp/Acme.BookStore.HttpApi.Client.ConsoleTestApp.csproj b/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.HttpApi.Client.ConsoleTestApp/Acme.BookStore.HttpApi.Client.ConsoleTestApp.csproj index af90ca7a55..7c32b6f914 100644 --- a/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.HttpApi.Client.ConsoleTestApp/Acme.BookStore.HttpApi.Client.ConsoleTestApp.csproj +++ b/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.HttpApi.Client.ConsoleTestApp/Acme.BookStore.HttpApi.Client.ConsoleTestApp.csproj @@ -20,5 +20,9 @@ + + + + diff --git a/samples/BookStore-Modular/application/test/Acme.BookStore.HttpApi.Client.ConsoleTestApp/Acme.BookStore.HttpApi.Client.ConsoleTestApp.csproj b/samples/BookStore-Modular/application/test/Acme.BookStore.HttpApi.Client.ConsoleTestApp/Acme.BookStore.HttpApi.Client.ConsoleTestApp.csproj index af90ca7a55..7c32b6f914 100644 --- a/samples/BookStore-Modular/application/test/Acme.BookStore.HttpApi.Client.ConsoleTestApp/Acme.BookStore.HttpApi.Client.ConsoleTestApp.csproj +++ b/samples/BookStore-Modular/application/test/Acme.BookStore.HttpApi.Client.ConsoleTestApp/Acme.BookStore.HttpApi.Client.ConsoleTestApp.csproj @@ -20,5 +20,9 @@ + + + + diff --git a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/Acme.BookStore.BookManagement.Web.Host.csproj b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/Acme.BookStore.BookManagement.Web.Host.csproj index 34f8bcf4c1..d2022bb48f 100644 --- a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/Acme.BookStore.BookManagement.Web.Host.csproj +++ b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/Acme.BookStore.BookManagement.Web.Host.csproj @@ -19,7 +19,7 @@ - + diff --git a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/BookManagementWebHostModule.cs b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/BookManagementWebHostModule.cs index da1a8dc2fb..9e7c7db897 100644 --- a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/BookManagementWebHostModule.cs +++ b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/BookManagementWebHostModule.cs @@ -26,6 +26,7 @@ using Volo.Abp.Autofac; using Volo.Abp.AutoMapper; using Volo.Abp.Caching; using Volo.Abp.Http.Client.IdentityModel; +using Volo.Abp.Http.Client.IdentityModel.Web; using Volo.Abp.Identity; using Volo.Abp.Identity.Web; using Volo.Abp.Modularity; @@ -48,7 +49,7 @@ namespace Acme.BookStore.BookManagement typeof(AbpAspNetCoreMvcClientModule), typeof(AbpAspNetCoreMvcUiBasicThemeModule), typeof(AbpAutofacModule), - typeof(AbpHttpClientIdentityModelModule), + typeof(AbpHttpClientIdentityModelWebModule), typeof(AbpIdentityWebModule), typeof(AbpIdentityHttpApiClientModule), typeof(AbpTenantManagementWebModule), diff --git a/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.HttpApi.Client.ConsoleTestApp/Acme.BookStore.BookManagement.HttpApi.Client.ConsoleTestApp.csproj b/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.HttpApi.Client.ConsoleTestApp/Acme.BookStore.BookManagement.HttpApi.Client.ConsoleTestApp.csproj index 463c12d939..9e02f60d52 100644 --- a/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.HttpApi.Client.ConsoleTestApp/Acme.BookStore.BookManagement.HttpApi.Client.ConsoleTestApp.csproj +++ b/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.HttpApi.Client.ConsoleTestApp/Acme.BookStore.BookManagement.HttpApi.Client.ConsoleTestApp.csproj @@ -19,4 +19,8 @@ + + + + diff --git a/samples/BookStore/test/Acme.BookStore.HttpApi.Client.ConsoleTestApp/Acme.BookStore.HttpApi.Client.ConsoleTestApp.csproj b/samples/BookStore/test/Acme.BookStore.HttpApi.Client.ConsoleTestApp/Acme.BookStore.HttpApi.Client.ConsoleTestApp.csproj index c4387a063f..dcc021eee6 100644 --- a/samples/BookStore/test/Acme.BookStore.HttpApi.Client.ConsoleTestApp/Acme.BookStore.HttpApi.Client.ConsoleTestApp.csproj +++ b/samples/BookStore/test/Acme.BookStore.HttpApi.Client.ConsoleTestApp/Acme.BookStore.HttpApi.Client.ConsoleTestApp.csproj @@ -21,4 +21,8 @@ + + + + diff --git a/samples/DashboardDemo/test/DashboardDemo.HttpApi.Client.ConsoleTestApp/DashboardDemo.HttpApi.Client.ConsoleTestApp.csproj b/samples/DashboardDemo/test/DashboardDemo.HttpApi.Client.ConsoleTestApp/DashboardDemo.HttpApi.Client.ConsoleTestApp.csproj index ea3b5f2a53..3587fdc2b8 100644 --- a/samples/DashboardDemo/test/DashboardDemo.HttpApi.Client.ConsoleTestApp/DashboardDemo.HttpApi.Client.ConsoleTestApp.csproj +++ b/samples/DashboardDemo/test/DashboardDemo.HttpApi.Client.ConsoleTestApp/DashboardDemo.HttpApi.Client.ConsoleTestApp.csproj @@ -17,5 +17,9 @@ + + + + diff --git a/samples/EfCoreMigrationDemo/test/Acme.BookStore.HttpApi.Client.ConsoleTestApp/Acme.BookStore.HttpApi.Client.ConsoleTestApp.csproj b/samples/EfCoreMigrationDemo/test/Acme.BookStore.HttpApi.Client.ConsoleTestApp/Acme.BookStore.HttpApi.Client.ConsoleTestApp.csproj index 561ad3012d..d96dcacc8b 100644 --- a/samples/EfCoreMigrationDemo/test/Acme.BookStore.HttpApi.Client.ConsoleTestApp/Acme.BookStore.HttpApi.Client.ConsoleTestApp.csproj +++ b/samples/EfCoreMigrationDemo/test/Acme.BookStore.HttpApi.Client.ConsoleTestApp/Acme.BookStore.HttpApi.Client.ConsoleTestApp.csproj @@ -20,5 +20,9 @@ + + + + diff --git a/samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminApp.Host.csproj b/samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminApp.Host.csproj index bc29c3d237..cc23b9f584 100644 --- a/samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminApp.Host.csproj +++ b/samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminApp.Host.csproj @@ -25,7 +25,7 @@ - + diff --git a/samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminAppHostModule.cs b/samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminAppHostModule.cs index d04fc1e656..395b40aeb0 100644 --- a/samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminAppHostModule.cs +++ b/samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminAppHostModule.cs @@ -13,7 +13,7 @@ using Volo.Abp.AspNetCore.Authentication.OAuth; using Volo.Abp.AspNetCore.Mvc.Client; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; using Volo.Abp.Autofac; -using Volo.Abp.Http.Client.IdentityModel; +using Volo.Abp.Http.Client.IdentityModel.Web; using Volo.Abp.Identity; using Volo.Abp.Identity.Web; using Volo.Abp.Localization; @@ -27,7 +27,7 @@ namespace BackendAdminApp.Host typeof(AbpAutofacModule), typeof(AbpAspNetCoreMvcClientModule), typeof(AbpAspNetCoreAuthenticationOAuthModule), - typeof(AbpHttpClientIdentityModelModule), + typeof(AbpHttpClientIdentityModelWebModule), typeof(AbpIdentityHttpApiClientModule), typeof(AbpIdentityWebModule), typeof(BloggingApplicationContractsModule), diff --git a/samples/MicroserviceDemo/applications/ConsoleClientDemo/ConsoleClientDemo.csproj b/samples/MicroserviceDemo/applications/ConsoleClientDemo/ConsoleClientDemo.csproj index 7ee4c756aa..2443f75e5d 100644 --- a/samples/MicroserviceDemo/applications/ConsoleClientDemo/ConsoleClientDemo.csproj +++ b/samples/MicroserviceDemo/applications/ConsoleClientDemo/ConsoleClientDemo.csproj @@ -16,6 +16,10 @@ + + + + diff --git a/samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSite.Host.csproj b/samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSite.Host.csproj index 2370ae2a7a..24b6082352 100644 --- a/samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSite.Host.csproj +++ b/samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSite.Host.csproj @@ -24,7 +24,7 @@ - + diff --git a/samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSiteHostModule.cs b/samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSiteHostModule.cs index 66ea6d174c..4948995e35 100644 --- a/samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSiteHostModule.cs +++ b/samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSiteHostModule.cs @@ -11,7 +11,7 @@ using Volo.Abp.AspNetCore.Authentication.OAuth; using Volo.Abp.AspNetCore.Mvc.Client; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; using Volo.Abp.Autofac; -using Volo.Abp.Http.Client.IdentityModel; +using Volo.Abp.Http.Client.IdentityModel.Web; using Volo.Abp.Localization; using Volo.Abp.Modularity; using Volo.Abp.UI.Navigation; @@ -23,7 +23,7 @@ namespace PublicWebSite.Host typeof(AbpAutofacModule), typeof(AbpAspNetCoreMvcClientModule), typeof(AbpAspNetCoreAuthenticationOAuthModule), - typeof(AbpHttpClientIdentityModelModule), + typeof(AbpHttpClientIdentityModelWebModule), typeof(AbpAspNetCoreMvcUiBasicThemeModule), typeof(BloggingHttpApiClientModule), typeof(BloggingWebModule), diff --git a/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGateway.Host.csproj b/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGateway.Host.csproj index 89c3bdb5be..4e2bbba6a6 100644 --- a/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGateway.Host.csproj +++ b/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGateway.Host.csproj @@ -25,7 +25,7 @@ - + diff --git a/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGatewayHostModule.cs b/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGatewayHostModule.cs index 81a109a6f0..7004215dcf 100644 --- a/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGatewayHostModule.cs +++ b/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGatewayHostModule.cs @@ -14,7 +14,7 @@ using Volo.Abp; using Volo.Abp.Autofac; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore.SqlServer; -using Volo.Abp.Http.Client.IdentityModel; +using Volo.Abp.Http.Client.IdentityModel.Web; using Volo.Abp.Identity; using Volo.Abp.Modularity; using Volo.Abp.PermissionManagement; @@ -41,7 +41,7 @@ namespace BackendAdminAppGateway.Host typeof(BloggingApplicationContractsModule), typeof(AbpPermissionManagementDomainIdentityModule), typeof(AbpPermissionManagementDomainIdentityServerModule), - typeof(AbpHttpClientIdentityModelModule) + typeof(AbpHttpClientIdentityModelWebModule) )] public class BackendAdminAppGatewayHostModule : AbpModule { diff --git a/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingService.Host.csproj b/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingService.Host.csproj index 5bb58b92ec..024d64a5e4 100644 --- a/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingService.Host.csproj +++ b/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingService.Host.csproj @@ -25,7 +25,7 @@ - + diff --git a/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingServiceHostModule.cs b/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingServiceHostModule.cs index 2d7e945cf5..b72a4f56a6 100644 --- a/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingServiceHostModule.cs +++ b/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingServiceHostModule.cs @@ -19,7 +19,7 @@ using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore.SqlServer; using Volo.Abp.EventBus.RabbitMq; using Volo.Abp.Guids; -using Volo.Abp.Http.Client.IdentityModel; +using Volo.Abp.Http.Client.IdentityModel.Web; using Volo.Abp.Identity; using Volo.Abp.Localization; using Volo.Abp.Modularity; @@ -44,7 +44,7 @@ namespace BloggingService.Host typeof(BloggingHttpApiModule), typeof(BloggingMongoDbModule), typeof(BloggingApplicationModule), - typeof(AbpHttpClientIdentityModelModule), + typeof(AbpHttpClientIdentityModelWebModule), typeof(AbpIdentityHttpApiClientModule) )] public class BloggingServiceHostModule : AbpModule diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj index 697cbe1b44..ae37bbd5a1 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj @@ -31,7 +31,7 @@ - + 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 d2b050644f..102ff5eee9 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 @@ -27,7 +27,7 @@ using Volo.Abp.Autofac; using Volo.Abp.AutoMapper; using Volo.Abp.Caching; using Volo.Abp.FeatureManagement; -using Volo.Abp.Http.Client.IdentityModel; +using Volo.Abp.Http.Client.IdentityModel.Web; using Volo.Abp.Identity.Web; using Volo.Abp.Modularity; using Volo.Abp.MultiTenancy; @@ -48,7 +48,7 @@ namespace MyCompanyName.MyProjectName.Web typeof(AbpAspNetCoreMvcUiBasicThemeModule), typeof(AbpAutofacModule), typeof(AbpFeatureManagementWebModule), - typeof(AbpHttpClientIdentityModelModule), + typeof(AbpHttpClientIdentityModelWebModule), typeof(AbpIdentityWebModule), typeof(AbpTenantManagementWebModule), typeof(AbpAspNetCoreSerilogModule) diff --git a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp/MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp.csproj b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp/MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp.csproj index a70855393d..571b6a2d30 100644 --- a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp/MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp.csproj +++ b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp/MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp.csproj @@ -20,5 +20,9 @@ + + + + diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj index 338f55bc5f..d3e5f19e78 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj @@ -20,7 +20,7 @@ - + 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 41fb8fc7f2..41b48d4548 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 @@ -26,7 +26,7 @@ using Volo.Abp.Autofac; using Volo.Abp.AutoMapper; using Volo.Abp.Caching; using Volo.Abp.FeatureManagement; -using Volo.Abp.Http.Client.IdentityModel; +using Volo.Abp.Http.Client.IdentityModel.Web; using Volo.Abp.Identity; using Volo.Abp.Identity.Web; using Volo.Abp.Modularity; @@ -50,7 +50,7 @@ namespace MyCompanyName.MyProjectName typeof(AbpAspNetCoreMvcClientModule), typeof(AbpAspNetCoreMvcUiBasicThemeModule), typeof(AbpAutofacModule), - typeof(AbpHttpClientIdentityModelModule), + typeof(AbpHttpClientIdentityModelWebModule), typeof(AbpIdentityWebModule), typeof(AbpIdentityHttpApiClientModule), typeof(AbpTenantManagementWebModule), diff --git a/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp/MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp.csproj b/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp/MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp.csproj index 35f7e7344c..59de0da1ef 100644 --- a/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp/MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp.csproj +++ b/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp/MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp.csproj @@ -19,4 +19,8 @@ + + + +