Browse Source

Merge branch 'dev' into Add-localizations-for-Microservice-E-Book

pull/13308/head
Engincan VESKE 4 years ago
parent
commit
977e3b2691
  1. 16
      .github/workflows/auto-pr.yml
  2. 4
      abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json
  3. 9
      abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/en.json
  4. 9
      abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/zh-Hans.json
  5. 10
      abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json
  6. 3
      abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json
  7. 5
      abp_io/AbpIoLocalization/AbpIoLocalization/Www/AbpIoWwwResource.cs
  8. 33
      abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json
  9. 2
      common.props
  10. 12
      docs/en/Background-Jobs-RabbitMq.md
  11. 2
      docs/en/Background-Workers.md
  12. 380
      docs/en/Blog-Posts/2022-07-26 v6_0_Preview/POST.md
  13. BIN
      docs/en/Blog-Posts/2022-07-26 v6_0_Preview/blazor-chat-module-1.png
  14. BIN
      docs/en/Blog-Posts/2022-07-26 v6_0_Preview/blazor-chat-module-2.png
  15. BIN
      docs/en/Blog-Posts/2022-07-26 v6_0_Preview/cms-blog-blazor.png
  16. BIN
      docs/en/Blog-Posts/2022-07-26 v6_0_Preview/cms-blog-post-blazor.png
  17. BIN
      docs/en/Blog-Posts/2022-07-26 v6_0_Preview/cookie-banner.png
  18. BIN
      docs/en/Blog-Posts/2022-07-26 v6_0_Preview/cover-image.png
  19. BIN
      docs/en/Blog-Posts/2022-07-26 v6_0_Preview/dnf-summit-attendees.jpg
  20. BIN
      docs/en/Blog-Posts/2022-07-26 v6_0_Preview/dnf-summit.png
  21. BIN
      docs/en/Blog-Posts/2022-07-26 v6_0_Preview/excel-export.png
  22. BIN
      docs/en/Blog-Posts/2022-07-26 v6_0_Preview/export-excel-page.png
  23. BIN
      docs/en/Blog-Posts/2022-07-26 v6_0_Preview/get-started-page.png
  24. BIN
      docs/en/Blog-Posts/2022-07-26 v6_0_Preview/leptonx-lite-theme.png
  25. BIN
      docs/en/Blog-Posts/2022-07-26 v6_0_Preview/maui-mobile-option.gif
  26. BIN
      docs/en/Blog-Posts/2022-07-26 v6_0_Preview/maui-template.png
  27. BIN
      docs/en/Blog-Posts/2022-07-26 v6_0_Preview/poll-add-widget.png
  28. BIN
      docs/en/Blog-Posts/2022-07-26 v6_0_Preview/pricing-page.png
  29. BIN
      docs/en/Blog-Posts/2022-07-26 v6_0_Preview/pwa-support-get-started-page.png
  30. BIN
      docs/en/Blog-Posts/2022-07-26 v6_0_Preview/setting-management-emailing.png
  31. BIN
      docs/en/Blog-Posts/2022-07-26 v6_0_Preview/suite-create-new-solution.png
  32. BIN
      docs/en/Blog-Posts/2022-07-26 v6_0_Preview/suite-pwa-support.png
  33. 2
      docs/en/Community-Articles/2020-09-09-Replacing-Email-Template-and-Sending-Emails/POST.md
  34. 3
      docs/en/Distributed-Event-Bus-RabbitMQ-Integration.md
  35. 2
      docs/en/Distributed-Event-Bus.md
  36. 27
      docs/en/Migration-Guides/Abp-6_0.md
  37. 78
      docs/en/Migration-Guides/IdentityServer_To_OpenIddict.md
  38. 1
      docs/en/Migration-Guides/Index.md
  39. 4
      docs/en/Modules/OpenIddict.md
  40. 8
      docs/en/Object-To-Object-Mapping.md
  41. 2
      docs/en/SMS-Sending.md
  42. 2
      docs/en/Themes/LeptonXLite/Angular.md
  43. 2
      docs/en/Themes/LeptonXLite/AspNetCore.md
  44. 2
      docs/en/Themes/LeptonXLite/Blazor.md
  45. 22
      docs/en/Tutorials/Part-2.md
  46. 10
      docs/en/Tutorials/Part-3.md
  47. 2
      docs/en/UI/Angular/Basic-Theme.md
  48. 4
      docs/en/UI/Angular/Config-State-Service.md
  49. 2
      docs/en/UI/AspNetCore/Basic-Theme.md
  50. 4
      docs/en/UI/AspNetCore/Theming.md
  51. 2
      docs/en/UI/Blazor/Basic-Theme.md
  52. 140
      docs/es/Getting-Started-AspNetCore-Application.md
  53. BIN
      docs/es/images/create-aspnet-core-application.png
  54. BIN
      docs/es/images/create-new-aspnet-core-application-v2.png
  55. BIN
      docs/es/images/select-empty-web-application-v2.png
  56. 10
      docs/zh-Hans/Background-Jobs-RabbitMq.md
  57. 3
      docs/zh-Hans/Distributed-Event-Bus-RabbitMQ-Integration.md
  58. 8
      docs/zh-Hans/Object-To-Object-Mapping.md
  59. 22
      docs/zh-Hans/Tutorials/Part-2.md
  60. 10
      docs/zh-Hans/Tutorials/Part-3.md
  61. 5
      framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/PageToolbars/PageToolbarManager.cs
  62. 1
      framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationLocalizationConfigurationDto.cs
  63. 5
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/PageToolbars/PageToolbarManager.cs
  64. 2
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ExceptionHandling/AbpExceptionFilter.cs
  65. 2
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ExceptionHandling/AbpExceptionPageFilter.cs
  66. 52
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/DependencyInjection/HttpContextServiceScopeFactory.cs
  67. 4
      framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IDeletionAuditedObject.cs
  68. 2
      framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IHasDeletionTime.cs
  69. 2
      framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IHasModificationTime.cs
  70. 4
      framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IModificationAuditedObject.cs
  71. 16
      framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditPropertySetter.cs
  72. 6
      framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionDefinition.cs
  73. 2
      framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/AbpRabbitMqBackgroundJobOptions.cs
  74. 10
      framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueue.cs
  75. 6
      framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueueConfiguration.cs
  76. 15
      framework/src/Volo.Abp.BlazoriseUI/AbpBlazoriseUiModalExtensions.cs
  77. 4
      framework/src/Volo.Abp.Caching/Volo/Abp/Caching/DistributedCache.cs
  78. 3
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs
  79. 108
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs
  80. 5
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProxyCommandBase.cs
  81. 3
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/RemoveProxyCommand.cs
  82. 997
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStep.cs
  83. 76
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStyleStep.cs
  84. 2
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveDependencyFromPackageJsonFileStep.cs
  85. 9
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Theme.cs
  86. 8
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/ThemeStyle.cs
  87. 6
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ProjectBuildArgs.cs
  88. 6
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppNoLayersProTemplate.cs
  89. 6
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppNoLayersTemplate.cs
  90. 6
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppProTemplate.cs
  91. 6
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplate.cs
  92. 89
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs
  93. 6
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceProTemplate.cs
  94. 59
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceTemplateBase.cs
  95. 6
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/ExceptionMessageHelper.cs
  96. 22
      framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/DefaultServiceScopeFactory.cs
  97. 8
      framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/IHybridServiceScopeFactory.cs
  98. 4
      framework/src/Volo.Abp.Core/Volo/Abp/ISoftDelete.cs
  99. 36
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityChangeEventHelper.cs
  100. 23
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityChangingEventData.cs

16
.github/workflows/auto-pr.yml

@ -1,13 +1,13 @@
name: Merge branch dev with rel-5.3
name: Merge branch dev with rel-6.0
on:
push:
branches:
- rel-5.3
- rel-6.0
permissions:
contents: read
jobs:
merge-rel-5-3-with-rel-5-2:
merge-dev-with-rel-6-0:
permissions:
contents: write # for peter-evans/create-pull-request to create branch
pull-requests: write # for peter-evans/create-pull-request to create a PR
@ -18,13 +18,13 @@ jobs:
ref: dev
- name: Reset promotion branch
run: |
git fetch origin rel-5.3:rel-5.3
git reset --hard rel-5.3
git fetch origin rel-6.0:rel-6.0
git reset --hard rel-6.0
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
branch: auto-merge/rel-5-3/${{github.run_number}}
title: Merge branch dev with rel-5.3
body: This PR generated automatically to merge dev with rel-5.3. Please review the changed files before merging to prevent any errors that may occur.
branch: auto-merge/rel-6-0/${{github.run_number}}
title: Merge branch dev with rel-6.0
body: This PR generated automatically to merge dev with rel-6.0. Please review the changed files before merging to prevent any errors that may occur.
reviewers: ${{github.actor}}
token: ${{ github.token }}

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

@ -397,6 +397,8 @@
"BookDiscountDeletionConfirmationMessage": "Are you sure you want to delete this book discount?",
"CustomPaymentFlexSwitchDescription": "With license",
"AllowFeatureUpgradeOnLicenseExpire": "Allow feature upgrade on license expire",
"Deleted{0}": "[Deleted {0}]"
"Deleted{0}": "[Deleted {0}]",
"Tags": "Tags",
"SetTagsInfo": "Tags should be comma-separated. Eg: CSharp, Entity Framework"
}
}

9
abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/en.json

@ -164,6 +164,13 @@
"Books": "Books",
"ABPDiscordServer": "ABP Discord Server",
"ABPCommunityTalks": "ABP Community Talks",
"ABPCommunityPosts": "ABP Community Posts"
"ABPCommunityPosts": "ABP Community Posts",
"BuyAndGetMonths": "BUY 12 MONTHS, <span class=\"text-info\">GET 14 MONTHS!</span>",
"GetYourDeal": "Get Your Deal",
"BuyOrRenewLicense": "Buy or Renew License Now and Get 2 Extra Months!",
"BuyOrRenewLicenseToGetExtra2Months": "Buy or Renew License Now and Get 2 Extra Months! HURRY UP! ⏰ Last Day: {0}",
"HurryUp": "HURRY UP!",
"LastDay": "Last Day: {0}",
"BuyNewLicenseBetweenDatesToGetBenefit": "Buy a new license between {0} and {1} to get benefit for extra 2 months!"
}
}

9
abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/zh-Hans.json

@ -161,6 +161,13 @@
"Error_Page_500_Title": "好像出了什么问题!",
"Error_Page_500_Description_1": "我们会自动跟踪这些错误,但如果问题仍然存在,请随时 <br /> 联系我们。 与此同时,尝试刷新。",
"Error_Page_500_Description_2": "通过 <a href=\"mailto:info@abp.io\" target=\"_blank\">info@abp.io</a> 与我们联系。",
"Books": "书籍"
"Books": "书籍",
"BuyAndGetMonths": "购买 12 个月,<span class=\"text-info\">获得 14 个月!</span>",
"GetYourDeal": "得到你的交易",
"BuyOrRenewLicense": "立即购买或续订许可证并额外获得 2 个月!",
"BuyOrRenewLicenseToGetExtra2Months": "立即购买或续订 ABP 商业许可证(适用于所有版本)并额外获得 2 个月!",
"HurryUp": "赶快下单!",
"LastDay": "活动截止日期: {0}",
"BuyNewLicenseBetweenDatesToGetBenefit": "在 {0} 和 {1} 之间购买一个新的许可证以获得额外 2 个月的收益!"
}
}

10
abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json

@ -735,6 +735,14 @@
"ConfirmedEmailAddressRequiredToStartTrial": "You should have a confirmed email address in order to start a trial license.",
"EmailVerificationMailNotSent": "Email verification mail couldn't send.",
"GetConfirmationEmail": "<a href=\"javascript:void(0);\" id=\"{0}\">Click here to get a confirmation email</a> if you haven't got it before.",
"WhichLicenseTypeYouAreInterestedIn": "Which license type you are interested in?"
"WhichLicenseTypeYouAreInterestedIn": "Which license type you are interested in?",
"DontTakeOurWordForIt": "Don't take our word for it...",
"ReadAbpCommercialUsersWantYouToKnow": "Read what ABP Commercial users want you to know",
"Testimonial_ShortDescription_1": "The modularity of ABP made it possible for the team to deliver in time.",
"Testimonial_ShortDescription_2": "Build new features faster than before.",
"Testimonial_ShortDescription_3": "We start from out-of-the-box features and just focus on what we really need to write.",
"Testimonial_ShortDescription_4": "ABP Commercial was the best fit for our needs.",
"OnlineReviewersOnAbpCommercial": "Online Reviews on ABP Commercial",
"SeeWhatToldAboutAbpCommercial": "See what has been told about ABP Commercial and write your thoughts if you want."
}
}

3
abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json

@ -184,6 +184,7 @@
"Post_Index_Page_MetaDescription": "ABP Community's purpose is to create a contribution environment for developers who use the ABP framework.",
"Layout_Title": "{0} | ABP Community",
"Layout_MetaDescription": "ABP Community is an environment where people can share posts about ABP framework and follows the projects.",
"Index_Page_CommunityIntroduction": "This is a hub for ABP Framework, .NET and software development. You can read the articles, watch the video tutorials, get informed about ABP’s development progress and ABP-related events, help other developers and share your expertise with the ABP community."
"Index_Page_CommunityIntroduction": "This is a hub for ABP Framework, .NET and software development. You can read the articles, watch the video tutorials, get informed about ABP’s development progress and ABP-related events, help other developers and share your expertise with the ABP community.",
"TagsInArticle": "Tags in article"
}
}

5
abp_io/AbpIoLocalization/AbpIoLocalization/Www/AbpIoWwwResource.cs

@ -1,5 +1,8 @@
namespace AbpIoLocalization.Www
using Volo.Abp.Localization;
namespace AbpIoLocalization.Www
{
[LocalizationResourceName("AbpIoWww")]
public class AbpIoWwwResource
{

33
abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json

@ -373,18 +373,25 @@
"MasteringAbpFramework_Book_WhoIsThisBookFor": "Who's this book for",
"MasteringAbpFramework_Book_WhoIsThisBookFor_Description": "This book is for web developers who want to learn software architectures and best practices for building\n maintainable web-based solutions using Microsoft technologies and ABP Framework. Basic knowledge of C#\n and ASP.NET Core is necessary to get started with this book.",
"ComputersAndTechnology": "Computers & Technology",
"BuildingMicroserviceSolutions":"Building Microservice Solutions",
"MicroserviceBookPracticalGuide":"This book is a reference guide for developing and managing microservice-based applications using the ABP Framework. It references the .*NET Microservice Sample Rerefence Application*: eShopOnContainers and discusses the architectural design and implementation approaches using the ABP Framework. Moreover, you will learn the working implementation of an e-shop process like adding products, completing the purchase using PayPal, updating the basket cart item in real-time, shipping a purchased product, and more. Written by the main contributors of the ABP Framework, this book will help you understand how the ABP modularity is used like lego pieces to become a running distributed system. It will discuss the decisions to create a microservice environment and how to develop an application rapidly.By the end of this book, you'll learn how ABP approaches the common microservice complexities such as authorization, distributed transactions, inter-microservice communications, deployment, etc. ",
"IntroducingMicroservice":"Introducing Microservice",
"RunningTheSolution":"Running the Solution",
"UnderstandingTheAuthenticationSystem":"Understanding the Authentication System",
"ExploringTheApplications":"Exploring the Applications",
"UnderstandingTheAPIGateways":"Understanding the API Gateways",
"DevelopingTheMicroservices":"Developing the Microservices",
"UnderstandingTheInfrastructure":"Understanding the Infrastructure",
"DiggingInTheUseCases":"Digging in the Use Cases",
"DeployingTheSolution":"Deploying the Solution",
"Authors":"Authors",
"MicroserviceEBook":"Microservice E-Book"
"BuildingMicroserviceSolutions": "Building Microservice Solutions",
"MicroserviceBookPracticalGuide": "This book is a reference guide for developing and managing microservice-based applications using the ABP Framework. It references the .*NET Microservice Sample Rerefence Application*: eShopOnContainers and discusses the architectural design and implementation approaches using the ABP Framework. Moreover, you will learn the working implementation of an e-shop process like adding products, completing the purchase using PayPal, updating the basket cart item in real-time, shipping a purchased product, and more. Written by the main contributors of the ABP Framework, this book will help you understand how the ABP modularity is used like lego pieces to become a running distributed system. It will discuss the decisions to create a microservice environment and how to develop an application rapidly.By the end of this book, you'll learn how ABP approaches the common microservice complexities such as authorization, distributed transactions, inter-microservice communications, deployment, etc. ",
"IntroducingMicroservice": "Introducing Microservice",
"RunningTheSolution": "Running the Solution",
"UnderstandingTheAuthenticationSystem": "Understanding the Authentication System",
"ExploringTheApplications": "Exploring the Applications",
"UnderstandingTheAPIGateways": "Understanding the API Gateways",
"DevelopingTheMicroservices": "Developing the Microservices",
"UnderstandingTheInfrastructure": "Understanding the Infrastructure",
"DiggingInTheUseCases": "Digging in the Use Cases",
"DeployingTheSolution": "Deploying the Solution",
"Authors": "Authors",
"MicroserviceEBook": "Microservice E-Book",
"SelectUITheme": "Select UI Theme",
"LeptonXLiteTheme": "LeptonX Lite Theme",
"BasicTheme": "Basic Theme",
"LeptonXLiteThemeInfo": " A modern and stylish Bootstrap UI theme. Ideal if you want to have a production ready UI theme. This is the newest theme and is the default.",
"BasicThemeInfo": "Minimalist UI theme with plain Bootstrap colors and styles. Ideal if you will build your own UI theme.",
"SeeDocumentation": "See <a href='{0}' target='_blank'>documentation</a>.",
"SeeFullScreen": "<a href='{0}' target='_blank'>🖼️ See the screenshot</a>"
}
}

2
common.props

@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>6.0.0</Version>
<Version>7.0.0</Version>
<NoWarn>$(NoWarn);CS1591;CS0436</NoWarn>
<PackageIconUrl>https://abp.io/assets/abp_nupkg.png</PackageIconUrl>
<PackageProjectUrl>https://abp.io/</PackageProjectUrl>

12
docs/en/Background-Jobs-RabbitMq.md

@ -126,25 +126,31 @@ By default, all the job types use the `Default` RabbitMQ connection.
Configure<AbpRabbitMqBackgroundJobOptions>(options =>
{
options.DefaultQueueNamePrefix = "my_app_jobs.";
options.DefaultDelayedQueueNamePrefix = "my_app_jobs.delayed"
options.PrefetchCount = 1;
options.JobQueues[typeof(EmailSendingArgs)] =
new JobQueueConfiguration(
typeof(EmailSendingArgs),
queueName: "my_app_jobs.emails",
connectionName: "SecondConnection"
connectionName: "SecondConnection",
delayedQueueName:"my_app_jobs.emails.delayed"
);
});
````
* This example sets the default queue name prefix to `my_app_jobs.`. If different applications use the same RabbitMQ server, it would be important to use different prefixes for each application to not consume jobs of each other.
* This example sets the default queue name prefix to `my_app_jobs.` and default delayed queue name prefix to `my_app_jobs.delayed`. If different applications use the same RabbitMQ server, it would be important to use different prefixes for each application to not consume jobs of each other.
* Sets `PrefetchCount` for all queues.
* Also specifies a different connection string for the `EmailSendingArgs`.
`JobQueueConfiguration` class has some additional options in its constructor;
* `queueName`: The queue name that is used for this job. The prefix is not added, so you need to specify the full name of the queue.
* `DelayedQueueName`: The delayed queue name that is used for delayed execution of job. The prefix is not added, so you need to specify the full name of the queue.
* `connectionName`: The RabbitMQ connection name (see the connection configuration above). This is optional and the default value is `Default`.
* `durable` (optional, default: `true`).
* `exclusive` (optional, default: `false`).
* `autoDelete` (optional, default: `false`)
* `autoDelete` (optional, default: `false`).
* `PrefetchCount` (optional, default: null)
See the RabbitMQ documentation if you want to understand the `durable`, `exclusive` and `autoDelete` options better, while most of the times the default configuration is what you want.

2
docs/en/Background-Workers.md

@ -128,7 +128,7 @@ Be careful if you run multiple instances of your application simultaneously in a
If that's a problem for your workers, you have the following options:
* Implement your background workers so that they work in a clustered environment without any problem. Using the [distributed lock](../Distributed-Locking.md) to ensure concurrency control is a way of doing that. A background worker in an application instance may handle a distributed lock, so the workers in other application instances will wait for the lock. In this way, only one worker does the actual work, while others wait in idle. If you implement this, your workers run safely without caring about how the application is deployed.
* Implement your background workers so that they work in a clustered environment without any problem. Using the [distributed lock](Distributed-Locking.md) to ensure concurrency control is a way of doing that. A background worker in an application instance may handle a distributed lock, so the workers in other application instances will wait for the lock. In this way, only one worker does the actual work, while others wait in idle. If you implement this, your workers run safely without caring about how the application is deployed.
* Stop the background workers (set `AbpBackgroundWorkerOptions.IsEnabled` to `false`) in all application instances except one of them, so only the single instance runs the workers.
* Stop the background workers (set `AbpBackgroundWorkerOptions.IsEnabled` to `false`) in all application instances and create a dedicated application (maybe a console application running in its own container or a Windows Service running in the background) to execute all the background tasks. This can be a good option if your background workers consume high system resources (CPU, RAM or Disk), so you can deploy that background application to a dedicated server and your background tasks don't affect your application's performance.

380
docs/en/Blog-Posts/2022-07-26 v6_0_Preview/POST.md

@ -0,0 +1,380 @@
# ABP.IO Platform 6.0 RC Has Been Released
Today, we are happy to release the [ABP Framework](https://abp.io/) and [ABP Commercial](https://commercial.abp.io/) version **6.0 RC** (release candidate). This blog post introduces the new features and important changes in this new version.
> **The planned release date for the [6.0.0 Stable](https://github.com/abpframework/abp/milestone/71) version is September 06, 2022**.
Try this version and provide feedback for the stable ABP v6.0! Thank you to all.
## Get Started with the 6.0 RC
Follow the steps below to try version 6.0.0 RC today:
1) **Upgrade** the ABP CLI to version `6.0.0-rc.1` using a command line terminal:
````bash
dotnet tool update Volo.Abp.Cli -g --version 6.0.0-rc.1
````
**or install** it if you haven't before:
````bash
dotnet tool install Volo.Abp.Cli -g --version 6.0.0-rc.1
````
2) Create a **new application** with the `--preview` option:
````bash
abp new BookStore --preview
````
See the [ABP CLI documentation](https://docs.abp.io/en/abp/latest/CLI) for all the available options.
> You can also use the *Direct Download* tab on the [Get Started](https://abp.io/get-started) page by selecting the **Preview checkbox**.
You can use any IDE that supports .NET 6.x, like **[Visual Studio 2022](https://visualstudio.microsoft.com/downloads/)**.
## Migration Guides
There are breaking changes in this version that may affect your application.
Please see the following migration documents, if you are upgrading from v5.3.0:
* [ABP Framework 5.3 to 6.0 Migration Guide](https://docs.abp.io/en/abp/6.0/Migration-Guides/Abp-6_0)
* [ABP Commercial 5.3 to 6.0 Migration Guide](https://docs.abp.io/en/commercial/6.0/migration-guides/v6_0)
## What's New with ABP Framework 6.0?
In this section, I will introduce some major features released in this version. Here is a brief list of titles explained in the next sections:
* **LeptonX Lite** is now the **default theme** for startup templates.
* Optional PWA support is added to [*Get Started*](https://abp.io/get-started) page.
* Introducing the **OpenIddict Module** and switching to OpenIddict for the startup templates.
* New **.NET MAUI** Startup Template.
* Introducing the `ITransientCachedServiceProvider` interface.
* Introducing the dynamic components for Blazor UI.
* Improvements on ABP CLI.
* Introducing the `Volo.Abp.RemoteServices` package.
* Create/Update user accounts for external logins.
* Sending test email in the setting page for MVC and Blazor user interfaces.
* Improvements on the **eShopOnAbp** project.
* Other news...
### LeptonX Lite Theme on Startup Templates
![](leptonx-lite-theme.png)
With this version, startup templates (`app` and `app-nolayers` templates) use the **LeptonX Lite** as the default theme. However, it's still possible to create a project with **Basic Theme** either using the **ABP CLI** or downloading the project via [*Get Started*](https://abp.io/get-started) page on the [abp.io](https://abp.io/) website.
#### via ABP CLI
To create a new project with **Basic Theme**, you can use the `--theme` option as below:
```bash
abp new Acme.BookStore --theme basic --preview
```
#### via Get Started page
Also, you can create a new project with **LeptonX Lite** or **Basic Theme** on *Get Started* page.
![](get-started-page.png)
> The "Preview" checkbox should be checked to be able to see the theme selection section on the *Get Started* page.
### Optional PWA Support is Added to the Get Started Page
We've introduced the PWA (Progressive Web Application) support for the startup templates for Angular & Blazor WASM UIs in **v5.3**. In this version, we also added this PWA support to the [*Get Started*](https://abp.io/get-started) page on the [abp.io](https://abp.io/) website.
![](pwa-support-get-started-page.png)
If you check the "Progressive Web Application" checkbox while creating an application, the all required configurations will be done for you and you will get the benefit of PWA features in your application.
### Introducing the **OpenIddict Module** and Switching to OpenIddict in the Startup Templates
We already [announced the plan of replacing the IdentityServer with OpenIddict](https://github.com/abpframework/abp/issues/11989).
Therefore, we have created the `OpenIddict` module in this version and switched to **OpenIddict** in the startup templates. The ABP Framework uses this module to add **OAuth** features to the applications. We created documentation for the **OpenIddict Module**.
- You can see the following document to **learn about the OpenIddict Module**:
[https://docs.abp.io/en/abp/6.0/Modules/OpenIddict](https://docs.abp.io/en/abp/6.0/Modules/OpenIddict)
- You can check out the following migration guide to learn **how to migrate to OpenIddict**:
[https://docs.abp.io/en/abp/6.0/Migration-Guides/IdentityServer_To_OpenIddict](https://docs.abp.io/en/abp/6.0/Migration-Guides/IdentityServer_To_OpenIddict)
> We will continue to ship Identity Server packages for a while but in the long term, you may need to replace it, because Identity Server support ends at the end of 2022. Please see the [announcement]((https://github.com/abpframework/abp/issues/11989)) for more info.
### New .NET MAUI Startup Template
![](maui-template.png)
ABP Framework provides .NET MAUI startup templates with **v6.0.0**. You can create a new .NET MAUI project with the command below:
```bash
abp new Acme.BookStore -t maui
```
### Introducing the `ITransientCachedServiceProvider`
`ICachedServiceProvider` interface is used to resolve the cached services within a new scope. We created a new interface to resolve cached services **without creating scopes**. It's called `ITransientCachedServiceProvider`. The difference between `ICachedServiceProvider` and `ITransientCachedServiceProvider` is; `ITransientCachedServiceProvider` is transient. Check out [this issue](https://github.com/abpframework/abp/issues/12918) for more information.
### Introducing the dynamic layout components for Blazor UI
ABP Framework provides different ways of customizing the UI and one of them is to use [Layout Hooks](https://docs.abp.io/en/abp/latest/UI/AspNetCore/Layout-Hooks) in MVC. The **Layout Hook System** allows you to add code to some specific parts of the layout and all layouts of the themes provided by the ABP Framework implement these hooks.
However, Blazor UI doesn't have such a system yet and we are planning to implement [Layout Hooks for the Blazor UI](https://github.com/abpframework/abp/issues/6261) in version 7.0.
We are introducing the dynamic layout components for the Blazor UI to be able to add components to the Blazor layouts.
You can configure the `AbpDynamicLayoutComponentOptions` to render your components in the layout, as below:
```csharp
Configure<AbpDynamicLayoutComponentOptions>(options =>
{
options.Components.Add(typeof(MyBlazorComponent), null);
});
```
### Improvements in ABP CLI
There are some enhancements in [ABP CLI](https://docs.abp.io/en/abp/6.0/CLI). You can see the brief list of some of these improvements below:
* You can list all available templates by using the `abp list-templates` command with v6.0. See [#13083](https://github.com/abpframework/abp/pull/13083).
* You can select the theme when creating a new project by specifying the `--theme` option. You can see the *LeptonX Lite Theme on the Startup Templates* section above for an example.
* `abp update` command has been updating the version of the main application until now. With v6.0.0, this command updates all package versions **inside all solutions in the sub-folders**. Checkout the issue [#12735](https://github.com/abpframework/abp/pull/12738) for more information.
### Introducing the `Volo.Abp.RemoteService` Package
A new `Volo.Abp.RemoteService` package has been added to the framework. Some of the classes that are related to the remote service configurations such as `AbpRemoteServiceOptions` class moved from `Volo.Abp.Http.Client` to this package. In this way, it became more reusable for further usages.
### Create/Update User Accounts For External Logins
If a user authenticates from an external provider like `Keycloak`, the user is being redirected to this external provider, and comes back to the main application. In this process, the user's data is not being saved in the main application's database. With this version, ABP saves the user information and lists in the users page. And this fixes permission management, user information mismatches and other issues. For more info, see [the related issue](https://github.com/abpframework/abp/issues/12203).
### Sending test email in the setting page for MVC and Blazor UIs
"Sending Test Email" feature is added to the [Setting Management](https://docs.abp.io/en/abp/6.0/Modules/Setting-Management) module, which allows checking the email settings are configured properly and sending emails successfully to the target email address.
![](setting-management-emailing.png)
After configuring the email settings such as the target email address, you can click the "Send" button to send a test email to see if everything went well.
> Note that this feature will be implemented for the Angular UI in the stable v6.0.
### Improvements on eShopOnAbp Project
The following improvements have been made on [eShopOnAbp project](https://github.com/abpframework/eShopOnAbp) with this version:
* Some improvements have been made on the Admin Application for Order Management for Angular UI. See [#110](https://github.com/abpframework/eShopOnAbp/pull/110).
* `SignalR` error on Kubernetes & Docker Compose has been fixed. See [#113](https://github.com/abpframework/eShopOnAbp/pull/113).
* eShopOnAbp project has been deployed to Azure Kubernetes Service. See [#114](https://github.com/abpframework/eShopOnAbp/pull/114). The live demo can be seen from [eshoponabp.com](https://eshoponabp.com/).
* Configurations have been made for some services on the `docker-compose.yml` file. See [#112](https://github.com/abpframework/eShopOnAbp/pull/112).
* Gateway Redirect Loop problem on Kubernetes has been fixed. See [the commit](https://github.com/abpframework/eShopOnAbp/commit/6413ef15c91cd8a5309050b63bb4dbca23587607).
### Other News
* Autofac library has been upgraded to **v6.4.0**. Please see [#12816](https://github.com/abpframework/abp/pull/12816) for more info.
* Performance Improvements have been made in the **Settings Module** and tabs on the *Settings* page are lazy loading now.
* Some improvements have been made in the CMS Kit Module. You can see the improvements from [here](https://github.com/abpframework/abp/issues/11965).
If you want to see more details, you can check [the release on GitHub](https://github.com/abpframework/abp/releases/tag/6.0.0-rc.1), which contains a list of all the issues and pull requests closed in this version.
## What's New with ABP Commercial 6.0?
### LeptonX Theme is the Default Theme
With this version, the startup templates (`app-pro`, `app-nolayers-pro` and `microservice-pro` templates) use the **LeptonX Theme** as the default theme. However, it's still possible to create a new project with **Lepton Theme** or **Basic Theme**, either using the **ABP CLI** or **ABP Suite**.
#### via ABP CLI
To create a new project with **Lepton Theme** or **Basic Theme**, you can use the `--theme` option as below. For "Basic Theme" specify the theme name as `--theme basic`.
```bash
abp new Acme.BookStore --theme lepton --preview
```
#### via ABP Suite
Also, you can create a new project with **Lepton Theme** or **Basic Theme** from ABP Suite.
![](suite-create-new-solution.png)
### Switching to OpenIddict in the Startup Templates
We have also switched to the **OpenIddict** for the startup templates for ABP Commercial as explained above.
### New .NET MAUI Mobile
![](maui-mobile-option.gif)
ABP Commercial has been providing a [React Native](https://docs.abp.io/en/commercial/latest/getting-started-react-native) mobile app since with the very early versions. Alternative to this application, we created a new .NET MAUI mobile app. To create a new `app-pro` ABP project with the .NET MAUI mobile app, you can use the command below:
```bash
abp new Acme.BookStore -t app-pro --mobile maui
```
> Note that, when Microsoft supports `WebAuthenticator` on Windows, we'll also support it to work on Windows OS.
### GDPR: Cookie Consent
![](cookie-banner.png)
With this version, the **Cookie Consent** feature has been added to the **GDPR** module. It's enabled by default for the new startup templates. There are two pages in the templates: "Cookie Policy" page and "Privacy Policy" page.
If you want to disable/hide the "Cookie Consent", you can simply open the startup project module class and set the `IsEnabled` property as **false** for the **AddAbpCookieConsent** method as below:
```csharp
context.Services.AddAbpCookieConsent(options =>
{
options.IsEnabled = false; //disabled
options.CookiePolicyUrl = "/CookiePolicy";
options.PrivacyPolicyUrl = "/PrivacyPolicy";
});
```
> These pages are used to build up the cookie consent text and you can change the content or url of these pages by your needs.
If you want to use the Cookie Consent feature of the GDPR module in your existing project, please see the [GDPR Module](https://docs.abp.io/en/commercial/6.0/modules/gdpr) documentation for configurations.
### Improvements/Developments on CMS Kit Poll
Some improvements have been made on the Poll System of CMS Kit module as listed below:
* The Widget rendering and Admin side for the Blazor UI improvements.
* A Widget can be picked from the editor as seen in the image below.
![](poll-add-widget.png)
### Blazor UI for the Chat Module
Chat Module is now also available for the Blazor UI after the MVC and Angular UIs. You can read the [Chat Module](https://docs.abp.io/en/commercial/6.0/modules/chat) documentation to get the overall knowledge about the module and add to your application.
![](blazor-chat-module-1.png)
![](blazor-chat-module-2.png)
### Blazor Admin UI for CMS Kit Module
All admin side **CMS Kit** and **CMS Kit Pro** features have been implemented for the Blazor UI. Blazor UI will only be available to ABP Commercial customers.
![](cms-blog-blazor.png)
![](cms-blog-post-blazor.png)
### Suite: Excel Export
With v6.0, now it's possible to export the records as Excel for Blazor & MVC UIs. Angular UI is still in-progress, and we will implement it with the stable v6.0 release. Check the "Excel export" checkbox to add this feature.
![](excel-export.png)
A new Excel Export button is being located at the top of the generated page as seen below:
![](export-excel-page.png)
Then, you can download the records as `.xlsx` format by clicking the "Excel Export" button. Note that the exported Excel list is the filtered list.
### ABP Suite: Optional PWA Support
With this version, it's possible to add the [PWA (Progressive Web App)](https://web.dev/progressive-web-apps/?gclid=Cj0KCQjwxIOXBhCrARIsAL1QFCY0IB-W5k-lsXmRCbm00sl4nyBIYynAX3IdJkjyizyNUjuCE8zeu24aApxtEALw_wcB) support for Blazor & Angular UIs while creating the application via Suite.
![](suite-pwa-support.png)
You just need to check the "Progressive web application" checkbox, when creating a new application. Then, ABP Suite will add the PWA support to your application. When you publish your application, you get the full benefits of PWA features such as offline support.
### Other News
#### Explainer Videos
We are creating explainer videos for the ABP Commercial Modules to provide an overview. Within this milestone, we've created four new explainer videos:
* [Audit Logging Module](https://www.youtube.com/watch?v=NzSuFBpqfsc)
* [Identity Module](https://www.youtube.com/watch?v=W87jA_GBE54)
* [SaaS Module](https://www.youtube.com/watch?v=xXlaaXP6qqQ)
* [Forms Module](https://www.youtube.com/watch?v=MousWEPfrA8)
You can subscribe to [Volosoft's YouTube channel](https://www.youtube.com/channel/UCO3XKlpvq8CA5MQNVS6b3dQ) to be informed about the future ABP events and videos.
### Trial License is now available!
![](pricing-page.png)
If you are considering purchasing a new ABP Commercial license, and you want to see ABP in action then, check out https://commercial.abp.io/pricing and click FREE TRIAL button.
## Community News
### New ABP Community Posts
* [Alper Ebicoglu](https://twitter.com/alperebicoglu) has created a new community article to give a full overview of .NET MAUI. You can read it [here](https://community.abp.io/posts/all-about-.net-maui-gb4gkdg5).
* [Anto Subash](https://twitter.com/antosubash) has created a new video content to show "State Management in Blazor with Fluxor". You can read it [here](https://community.abp.io/posts/blazor-state-management-with-fluxor-raskpv19).
* [Learn ABP Framework](https://community.abp.io/members/learnabp) has also created a new video content to show "How to install LeptonX Lite Theme for ABP Framework 5.3 MVC UI". You can read it [here](https://community.abp.io/posts/how-to-install-leptonx-lite-theme-on-abp-framework-5.3-mvc-ui-epzng137).
* [Kirti Kulkarni](https://twitter.com/kirtimkulkarni) has created three new community articles. You can use the links below to read the articles:
* [Integrating the file management module with ABP Commercial application](https://community.abp.io/posts/integrating-the-file-management-module-with-abp-commercial-application-qd6v4dsr)
* [Work with PDF's in ABP Commercial Project using PDFTron](https://community.abp.io/posts/work-with-pdfs-in-abp-commercial-project-using-pdftron-tjw0hlgu)
* [Create a custom login page in ABP Commercial Angular app](https://community.abp.io/posts/create-a-custom-login-page-in-abp-commercial-angular-app-r2huidx7)
* [Don Boutwell](https://community.abp.io/members/dboutwell) has created his first ABP Community article. You can read it from [here](https://community.abp.io/posts/password-required-redis-with-abp-framework-and-docker-94old5rm).
### Volosoft Has Attended the DNF Summit 2022
![](dnf-summit.png)
Core team members of ABP Framework, [Halil Ibrahim Kalkan](https://twitter.com/hibrahimkalkan) and [Alper Ebicoglu](https://twitter.com/alperebicoglu) have attended the [DNF Summit](https://t.co/ngWnBLiAn5) on the 20th of July. Halil Ibrahim Kalkan talked about the creation of the ABP Framework and Alper Ebicoglu showed how easy to create a project with ABP Framework within 15 minutes.
Watch DNF Summit session 👉 https://www.youtube.com/embed/VL0ewZ-0ruo
![](dnf-summit-attendees.jpg)
## Conclusion
This version comes with some features and enhancements to the existing features. You can see the [Road Map](https://docs.abp.io/en/abp/6.0/Road-Map) documentation to learn about the release schedule and planned features for the next releases. The planned release date for the [6.0.0 Stable](https://github.com/abpframework/abp/milestone/71) version is September 06, 2022. Please try the ABP v6.0 RC and provide feedback to us.
Thanks for being a part of this community!

BIN
docs/en/Blog-Posts/2022-07-26 v6_0_Preview/blazor-chat-module-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
docs/en/Blog-Posts/2022-07-26 v6_0_Preview/blazor-chat-module-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

BIN
docs/en/Blog-Posts/2022-07-26 v6_0_Preview/cms-blog-blazor.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
docs/en/Blog-Posts/2022-07-26 v6_0_Preview/cms-blog-post-blazor.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
docs/en/Blog-Posts/2022-07-26 v6_0_Preview/cookie-banner.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

BIN
docs/en/Blog-Posts/2022-07-26 v6_0_Preview/cover-image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
docs/en/Blog-Posts/2022-07-26 v6_0_Preview/dnf-summit-attendees.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

BIN
docs/en/Blog-Posts/2022-07-26 v6_0_Preview/dnf-summit.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

BIN
docs/en/Blog-Posts/2022-07-26 v6_0_Preview/excel-export.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

BIN
docs/en/Blog-Posts/2022-07-26 v6_0_Preview/export-excel-page.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

BIN
docs/en/Blog-Posts/2022-07-26 v6_0_Preview/get-started-page.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

BIN
docs/en/Blog-Posts/2022-07-26 v6_0_Preview/leptonx-lite-theme.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

BIN
docs/en/Blog-Posts/2022-07-26 v6_0_Preview/maui-mobile-option.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

BIN
docs/en/Blog-Posts/2022-07-26 v6_0_Preview/maui-template.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

BIN
docs/en/Blog-Posts/2022-07-26 v6_0_Preview/poll-add-widget.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

BIN
docs/en/Blog-Posts/2022-07-26 v6_0_Preview/pricing-page.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

BIN
docs/en/Blog-Posts/2022-07-26 v6_0_Preview/pwa-support-get-started-page.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

BIN
docs/en/Blog-Posts/2022-07-26 v6_0_Preview/setting-management-emailing.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 KiB

BIN
docs/en/Blog-Posts/2022-07-26 v6_0_Preview/suite-create-new-solution.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
docs/en/Blog-Posts/2022-07-26 v6_0_Preview/suite-pwa-support.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

2
docs/en/Community-Articles/2020-09-09-Replacing-Email-Template-and-Sending-Emails/POST.md

@ -335,7 +335,7 @@ After sending the email we should see the template like below.
</div>
<div style="color:#ffffff;font-family:Poppins, Arial, Helvetica, sans-serif;line-height:1.8;padding-top:10px;padding-right:50px;padding-bottom:10px;padding-left:50px;">
<div style="line-height: 1.8; font-size: 12px; color: #ffffff; font-family: Poppins, Arial, Helvetica, sans-serif; mso-line-height-alt: 22px;">
<p style="line-height: 1.8; word-break: break-word; font-size: 14px; mso-line-height-alt: 25px; margin: 0;"><span style="font-size: 14px;">Share your experiences with the ABP Framework!</span><br/><span style="font-size: 14px;">ABP is an open source and community driven project. This guide is aims to help anyone wants to contribute to the project.</span></p>
<p style="line-height: 1.8; word-break: break-word; font-size: 14px; mso-line-height-alt: 25px; margin: 0;"><span style="font-size: 14px;">Share your experiences with the ABP Framework!</span><br/><span style="font-size: 14px;">ABP is an open source and community driven project. This guide is aimed to help anyone who wants to contribute to the project.</span></p>
<p style="line-height: 1.8; word-break: break-word; font-size: 14px; mso-line-height-alt: 25px; margin: 0;"><span style="font-size: 14px;">If you want to write articles or "how to" guides related to the ABP Framework and ASP.NET Core, please submit your article to the community.abp.io web site.</span></p>
</div>
</div>

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

@ -141,13 +141,14 @@ Configure<AbpRabbitMqOptions>(options =>
});
````
**Example: Configure the client and exchange names**
**Example: Configure the client, exchange names and prefetchCount**
````csharp
Configure<AbpRabbitMqEventBusOptions>(options =>
{
options.ClientName = "TestApp1";
options.ExchangeName = "TestMessages";
options.PrefetchCount = 1;
});
````

2
docs/en/Distributed-Event-Bus.md

@ -228,7 +228,7 @@ namespace AbpDemo
````
* `MyHandler` implements the `IDistributedEventHandler<EntityUpdatedEto<ProductEto>>`.
* It is required to register your handler class to the [dependency injection](Dependency-Injection.md) system. Implementing `ITransient` like in this example is an easy way.
* It is required to register your handler class to the [dependency injection](Dependency-Injection.md) system. Implementing `ITransientDependency` like in this example is an easy way.
### Configuration

27
docs/en/Migration-Guides/Abp-6_0.md

@ -0,0 +1,27 @@
# ABP Version 6.0 Migration Guide
This document is a guide for upgrading ABP v5.3 solutions to ABP v6.0. There is a change in this version that may affect your applications, please read it carefully and apply the necessary changes to your application.
## Added IsActive property
`IsActive` property is added to `IUserData`. This property is set to **true** by default. **Cmskit** and **Blog** modules are affected by this change. You need to add new migration to your existing application if you are using any of these modules. Please see [#11417](https://github.com/abpframework/abp/pull/11417) for more info.
## Default behavior change in MultiTenancyMiddlewareErrorPageBuilder
If you have customized the `MultiTenancyMiddlewareErrorPageBuilder` of `AbpMultiTenancyOptions`, the pipeline now returns **true** to stop the pipeline as the default behavior. See [AbpMultiTenancyOptions: Handle inactive and non-existent tenants](https://github.com/abpframework/abp/blob/dev/docs/en/Multi-Tenancy.md#abpmultitenancyoptions-handle-inactive-and-non-existent-tenants) for more info.
## Migrating to LeptonX Lite
LeptonX Lite is now being introduced and you can follow the guides below to migrate your existing applications:
- [Migrating to LeptonX MVC UI](../themes/LeptonXLite/AspNetCore.md)
- [Migrating to LeptonX Angular UI](../themes/LeptonXLite/angular.md)
- [Migrating to LeptonX Blazor UI](../themes/LeptonXLite/blazor.md)
## Migrating to OpenIddict
After the [announcement of plan to replace the IdentityServer](https://github.com/abpframework/abp/issues/11989), we have successfully implemented [Openiddict](https://github.com/openiddict/openiddict-core) as a replacement for IdentityServer4 as OpenID-Provider. You can follow [Migrating Identity Server to OpenIddict guide](./IdentityServer_To_OpenIddict.md).
## See Also
* [Official blog post for the 6.0 release](https://blog.abp.io/abp/ABP.IO-Platform-6.0-RC-Has-Been-Published)

78
docs/en/Migration-Guides/IdentityServer_To_OpenIddict.md

@ -0,0 +1,78 @@
# Migration Identity Server to OpenIddict Guide
This document explains how to migrate to [OpenIddict](https://github.com/openiddict/openiddict-core) from Identity Server. From now on the ABP startup templates uses `OpenIddict` as the auth server by default since version v6.0.0.
## History
We are not removing Identity Server packages and we will continue to release new versions of Identity Server related NuGet/NPM packages. That means you won't have an issue while upgrading to v6.0 when the stable version releases. We will continue to fix bugs in our packages for a while. ABP 7.0 will be based on .NET 7. If Identity Server continues to work with .NET 7, we will also continue to ship NuGet packages for our IDS integration.
On the other hand, Identity Server ends support for the open-source Identity Server in the end of 2022. The Identity Server team has decided to move to Duende IDS and ABP will not be migrated to the commercial Duende IDS. You can see the Duende Identity Server announcement from [this link](https://blog.duendesoftware.com/posts/20220111_fair_trade).
## OpenIddict Migration Steps
* Update all `Volo's` packages to `6.x`.
* Replace all `Volo's` `IdentityServer.*` packages with corresponding `OpenIddict.*` packages. eg `Volo.Abp.IdentityServer.Domain` to `Volo.Abp.OpenIddict.Domain`, `Volo.Abp.Account.Web.IdentityServer` to `Volo.Abp.Account.Web.OpenIddict`.
* Replace all `IdentityServer` modules with corresponding `OpenIddict` modules. eg `AbpIdentityServerDomainModule` to `AbpOpenIddictDomainModule`, `AbpAccountWebIdentityServerModule` to `AbpAccountWebOpenIddictModule`.
* Rename the `ConfigureIdentityServer` to `ConfigureOpenIddict` in your `ProjectNameDbContext` class.
* Remove the `UseIdentityServer` and add `UseAbpOpenIddictValidation` after `UseAuthentication`.
* Add follow code to your startup module.
```cs
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<OpenIddictBuilder>(builder =>
{
builder.AddValidation(options =>
{
options.AddAudiences("ProjectName"); // Change ProjectName to your project name.
options.UseLocalServer();
options.UseAspNetCore();
});
});
}
```
* If your project is not separate AuthServer please also add `ForwardIdentityAuthenticationForBearer`
```cs
private void ConfigureAuthentication(ServiceConfigurationContext context)
{
context.Services.ForwardIdentityAuthenticationForBearer(OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme);
}
```
* Remove the `IdentityServerDataSeedContributor` from the `Domain` project.
* Create a new version of the project, with the same name as your existing project.
* Copy the `ProjectName.Domain\OpenIddict\OpenIddictDataSeedContributor.cs` of new project into your project and update `appsettings.json` base on `ProjectName.DbMigrator\appsettings.json`, Be careful to change the port number.
* Copy the `Index.cshtml.cs` and `Index.cs` of new project to your project if you're using `IClientRepository` in `IndexModel`.
* Update the scope name from `role` to `roles` in `AddAbpOpenIdConnect` method.
* Remove `options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);` from `HttpApi.Host` project.
* AuthServer no longer requires `JWT bearer authentication`. Please remove it. eg `AddJwtBearer` and `UseJwtTokenMiddleware`.
* Try compiling the project in the IDE and following the errors to remove and reference the code and namespaces.
* Add migrations and update the database if you are using EF Core as the database provider.
## Module packages
### Open source side
* Volo.Abp.OpenIddict.Domain (`AbpOpenIddictDomainModule`)
* Volo.Abp.OpenIddict.Domain.Shared (`AbpOpenIddictDomainSharedModule`)
* Volo.Abp.OpenIddict.EntityFrameworkCore (`AbpOpenIddictEntityFrameworkCoreModule`)
* Volo.Abp.OpenIddict.AspNetCore (`AbpOpenIddictAspNetCoreModule`)
* Volo.Abp.OpenIddict.MongoDB (`AbpOpenIddictMongoDbModule`)
* Volo.Abp.Account.Web.OpenIddict (`AbpAccountWebOpenIddictModule`)
* Volo.Abp.PermissionManagement.Domain.OpenIddict (`AbpPermissionManagementDomainOpenIddictModule`)
### Commercial side
* Volo.Abp.OpenIddict.Pro.Application.Contracts (`AbpOpenIddictProApplicationContractsModule`)
* Volo.Abp.OpenIddict.Pro.Application (`AbpOpenIddictProApplicationModule`)
* Volo.Abp.OpenIddict.Pro.HttpApi.Client (`AbpOpenIddictProHttpApiClientModule`)
* Volo.Abp.OpenIddict.Pro.HttpApi (`AbpOpenIddictProHttpApiModule`)
* Volo.Abp.OpenIddict.Pro.Blazor(`AbpOpenIddictProBlazorModule`)
* Volo.Abp.OpenIddict.Pro.Blazor.Server (`AbpOpenIddictProBlazorServerModule`)
* Volo.Abp.OpenIddict.Pro.Blazor.WebAssembly (`AbpOpenIddictProBlazorWebAssemblyModule`)
* Volo.Abp.OpenIddict.Pro.Web (`AbpOpenIddictProWebModule`)
## Source code of samples and module
* [Open source tiered & separate auth server application migrate Identity Server to OpenIddct](https://github.com/abpframework/abp-samples/tree/master/Ids2OpenId)
* [Commercial tiered & separate auth server application migrate Identity Server to OpenIddct](https://abp.io/Account/Login?returnUrl=/api/download/samples/Ids2OpenId)
* [OpenIddict module document](https://docs.abp.io/en/abp/6.0/Modules/OpenIddict)
* [OpenIddict module source code](https://github.com/abpframework/abp/tree/rel-6.0/modules/openiddict)

1
docs/en/Migration-Guides/Index.md

@ -2,6 +2,7 @@
The following documents explain how to migrate your existing ABP applications. We write migration documents only if you need to take an action while upgrading your solution. Otherwise, you can easily upgrade your solution using the [abp update command](../Upgrading.md).
- [5.3 to 6.0](Abp-6_0.md)
- [5.2 to 5.3](Abp-5_3.md)
- [5.1 to 5.2](Abp-5_2.md)
- [4.x to 5.0](Abp-5_0.md)

4
docs/en/Modules/OpenIddict.md

@ -1,9 +1,5 @@
## ABP OpenIddict Modules
## How to Install
TODO:
## User Interface
This module implements the domain logic and database integrations, but not provides any UI. Management UI is useful if you need to add applications and scopes on the fly. In this case, you may build the management UI yourself or consider to purchase the [ABP Commercial](https://commercial.abp.io/) which provides the management UI for this module.

8
docs/en/Object-To-Object-Mapping.md

@ -12,7 +12,7 @@ public class UserAppService : ApplicationService
_userRepository = userRepository;
}
public void CreateUser(CreateUserInput input)
public async Task CreateUser(CreateUserInput input)
{
//Manually creating a User object from the CreateUserInput object
var user = new User
@ -23,7 +23,7 @@ public class UserAppService : ApplicationService
Password = input.Password
};
_userRepository.Insert(user);
await _userRepository.InsertAsync(user);
}
}
```
@ -46,12 +46,12 @@ public class UserAppService : ApplicationService
_userRepository = userRepository;
}
public void CreateUser(CreateUserInput input)
public async Task CreateUser(CreateUserInput input)
{
//Automatically creating a new User object using the CreateUserInput object
var user = ObjectMapper.Map<CreateUserInput, User>(input);
_userRepository.Insert(user);
await _userRepository.InsertAsync(user);
}
}
````

2
docs/en/SMS-Sending.md

@ -80,7 +80,7 @@ The given `SendAsync` method in the example is an extension method to send an SM
## NullSmsSender
`NullSmsSender` is a the default implementation of the `ISmsSender`. It writes SMS content to the [standard logler](Logging.md), rather than actually sending the SMS.
`NullSmsSender` is a the default implementation of the `ISmsSender`. It writes SMS content to the [standard logger](Logging.md), rather than actually sending the SMS.
This class can be useful especially in development time where you generally don't want to send real SMS. **However, if you want to actually send SMS, you should implement the `ISmsSender` in your application code.**

2
docs/en/Themes/LeptonXLite/angular.md → docs/en/Themes/LeptonXLite/Angular.md

@ -7,6 +7,8 @@ LeptonX Lite has implementation for the ABP Framework Angular Client. It's a sim
## Installation
This theme is **already installed** when you create a new solution using the startup templates. If you are using any other template, you can install this theme by following the steps below:
To add `LeptonX-lite` into your project,
* Install `@abp/ng.theme.lepton-x`

2
docs/en/Themes/LeptonXLite/AspNetCore.md

@ -7,6 +7,8 @@ LeptonX Lite has implementation for the ABP Framework Razor Pages. It's a simpli
## Installation
This theme is **already installed** when you create a new solution using the startup templates. If you are using any other template, you can install this theme by following the steps below:
- Add **Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite** package to your **Web** application.
```bash

2
docs/en/Themes/LeptonXLite/blazor.md → docs/en/Themes/LeptonXLite/Blazor.md

@ -15,6 +15,8 @@ LeptonX Lite has implementation for the ABP Framework Blazor WebAssembly & Blazo
## Installation
This theme is **already installed** when you create a new solution using the startup templates. If you are using any other template, you can install this theme by following the steps below:
{{if UI == "Blazor"}}
- Complete the [MVC Razor Pages Installation](AspNetCore.md#installation) for the **HttpApi.Host** application first. _If the solution is tiered/micro-service, complete the MVC steps for all MVC applications such as **HttpApi.Host** and if identity server is separated, install to the **OpenIddict**_.

22
docs/en/Tutorials/Part-2.md

@ -135,22 +135,22 @@ Open the `en.json` (*the English translations*) file and change the content as s
"CreationTime": "Creation time",
"AreYouSure": "Are you sure?",
"AreYouSureToDelete": "Are you sure you want to delete this item?",
"Enum:BookType:0": "Undefined",
"Enum:BookType:1": "Adventure",
"Enum:BookType:2": "Biography",
"Enum:BookType:3": "Dystopia",
"Enum:BookType:4": "Fantastic",
"Enum:BookType:5": "Horror",
"Enum:BookType:6": "Science",
"Enum:BookType:7": "Science fiction",
"Enum:BookType:8": "Poetry"
"Enum:BookType.Undefined": "Undefined",
"Enum:BookType.Adventure": "Adventure",
"Enum:BookType.Biography": "Biography",
"Enum:BookType.Dystopia": "Dystopia",
"Enum:BookType.Fantastic": "Fantastic",
"Enum:BookType.Horror": "Horror",
"Enum:BookType.Science": "Science",
"Enum:BookType.ScienceFiction": "Science fiction",
"Enum:BookType.Poetry": "Poetry"
}
}
````
* Localization key names are arbitrary. You can set any name. We prefer some conventions for specific text types;
* Add `Menu:` prefix for menu items.
* Use `Enum:<enum-type>:<enum-value>` naming convention to localize the enum members. When you do it like that, ABP can automatically localize the enums in some proper cases.
* Use `Enum:<enum-type>.<enum-name>` or `<enum-type>.<enum-name>` or `<enum-name>` naming convention to localize the enum members. When you do it like that, ABP can automatically localize the enums in some proper cases.
If a text is not defined in the localization file, it **falls back** to the localization key (as ASP.NET Core's standard behavior).
@ -624,7 +624,7 @@ Open the `Books.razor` and replace the content as the following:
Field="@nameof(BookDto.Type)"
Caption="@L["Type"]">
<DisplayTemplate>
@L[$"Enum:BookType:{(int)context.Type}"]
@L[$"Enum:BookType.{Enum.GetName(context.Type)}"]
</DisplayTemplate>
</DataGridColumn>
<DataGridColumn TItem="BookDto"

10
docs/en/Tutorials/Part-3.md

@ -1224,7 +1224,7 @@ Open the `Books.razor` and add the following code to the end of the page:
@foreach (int bookTypeValue in Enum.GetValues(typeof(BookType)))
{
<SelectItem TValue="BookType" Value="@((BookType) bookTypeValue)">
@L[$"Enum:BookType:{bookTypeValue}"]
@L[$"Enum:BookType.{Enum.GetName((BookType)bookTypeValue)}"]
</SelectItem>
}
</Select>
@ -1322,7 +1322,7 @@ We can now define a modal to edit the book. Add the following code to the end of
@foreach (int bookTypeValue in Enum.GetValues(typeof(BookType)))
{
<SelectItem TValue="BookType" Value="@((BookType) bookTypeValue)">
@L[$"Enum:BookType:{bookTypeValue}"]
@L[$"Enum:BookType.{Enum.GetName((BookType)bookTypeValue)}"]
</SelectItem>
}
</Select>
@ -1459,7 +1459,7 @@ Here's the complete code to create the book management CRUD page, that has been
Field="@nameof(BookDto.Type)"
Caption="@L["Type"]">
<DisplayTemplate>
@L[$"Enum:BookType:{(int) context.Type}"]
@L[$"Enum:BookType.{Enum.GetName(context.Type)}"]
</DisplayTemplate>
</DataGridColumn>
<DataGridColumn TItem="BookDto"
@ -1511,7 +1511,7 @@ Here's the complete code to create the book management CRUD page, that has been
@foreach (int bookTypeValue in Enum.GetValues(typeof(BookType)))
{
<SelectItem TValue="BookType" Value="@((BookType) bookTypeValue)">
@L[$"Enum:BookType:{bookTypeValue}"]
@L[$"Enum:BookType.{Enum.GetName((BookType)bookTypeValue)}"]
</SelectItem>
}
</Select>
@ -1564,7 +1564,7 @@ Here's the complete code to create the book management CRUD page, that has been
@foreach (int bookTypeValue in Enum.GetValues(typeof(BookType)))
{
<SelectItem TValue="BookType" Value="@((BookType) bookTypeValue)">
@L[$"Enum:BookType:{bookTypeValue}"]
@L[$"Enum:BookType.{Enum.GetName((BookType)bookTypeValue)}"]
</SelectItem>
}
</Select>

2
docs/en/UI/Angular/Basic-Theme.md

@ -8,7 +8,7 @@ The Basic Theme is a theme implementation for the Angular UI. It is a minimalist
## Installation
**This theme is already installed** when you create a new solution using the [startup templates](../../Startup-Templates/Index.md). If you need to manually install it, follow the steps below:
If you need to manually this theme, follow the steps below:
* Install the [@abp/ng.theme.basic](https://www.npmjs.com/package/@abp/ng.theme.basic) NPM package to your Angular project.
* Open the `src/app/app.module.ts` file, import `ThemeBasicModule` (it can be imported from `@abp/ng.theme.basic` package), and add `ThemeBasicModule.forRoot()` to the `imports` array.

4
docs/en/UI/Angular/Config-State-Service.md

@ -122,8 +122,8 @@ You can get the application configuration response and set the `ConfigStateServi
```js
import {ApplicationConfigurationService, ConfigStateService} from '@abp/ng.core';
constructor(private applicationConfigurationService: ApplicationConfigurationService, private config: ConfigStateService) {
this.applicationConfigurationService.getConfiguration().subscribe(config => {
constructor(private abpApplicationConfigurationService: AbpApplicationConfigurationService, private config: ConfigStateService) {
this.abpApplicationConfigurationService.get().subscribe(config => {
this.config.setState(config);
})
}

2
docs/en/UI/AspNetCore/Basic-Theme.md

@ -10,7 +10,7 @@ The Basic Theme has RTL (Right-to-Left language) support.
## Installation
**This theme is already installed** when you create a new solution using the [startup templates](../../Startup-Templates/Index.md). If you need to manually install it, follow the steps below:
If you need to manually this theme, follow the steps below:
* Install the [Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic](https://www.nuget.org/packages/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic) NuGet package to your web project.
* Add `AbpAspNetCoreMvcUiBasicThemeModule` into the `[DependsOn(...)]` attribute for your [module class](../../Module-Development-Basics.md) in the web project.

4
docs/en/UI/AspNetCore/Theming.md

@ -16,10 +16,12 @@ In order to accomplish these goals, ABP Framework;
### Current Themes
Currently, two themes are **officially provided**:
Currently, four themes are **officially provided**:
* The [Basic Theme](Basic-Theme.md) is the minimalist theme with the plain Bootstrap style. It is **open source and free**.
* The [LeptonX Lite Theme](../../Themes/LeptonXLite/AspNetCore.md) is modern and stylish Bootstrap UI theme. It is ideal if you want to have a production ready UI theme. It is also **open source and free**.
* The [Lepton Theme](https://commercial.abp.io/themes) is a **commercial** theme developed by the core ABP team and is a part of the [ABP Commercial](https://commercial.abp.io/) license.
* The [LeptonX Theme](https://docs.abp.io/en/commercial/6.0/themes/leptonx) is also a **commercial** theme developed by the core ABP theme and is a part of the [ABP Commercial](https://commercial.abp.io/) license. This is the default theme after ABP v6.0.0.
There are also some community-driven themes for the ABP Framework (you can search on the web).

2
docs/en/UI/Blazor/Basic-Theme.md

@ -15,7 +15,7 @@ The Basic Theme is a theme implementation for the Blazor UI. It is a minimalist
## Installation
**This theme is already installed** when you create a new solution using the [startup templates](../../Startup-Templates/Index.md). If you need to manually install it, follow the steps below:
If you need to manually this theme, follow the steps below:
{{if UI == "Blazor"}}

140
docs/es/Getting-Started-AspNetCore-Application.md

@ -0,0 +1,140 @@
# Empezando con ABP y una Aplicacion AspNet Core MVC Web
Este tutorial explica como empezar una aplicacion ABP desde cero usando las dependencias minimas. Uno generalmente desea
empezar con la **[plantilla de inicio](Getting-Started-AspNetCore-MVC-Template.md)**.
## Crea un Proyecto Nuevo
1. Crea una Aplicacion Web AspNet Core nueva usando Visual Studio 2022 (17.0.0+):
![](images/create-new-aspnet-core-application-v2.png)
2. Configura el nuevo proyecto:
![](images/select-empty-web-application-v2.png)
3. Presione el boton Create:
![create-aspnet-core-application](images/create-aspnet-core-application.png)
## Instale el paquete Volo.Abp.AspNetCore.Mvc
Volo.Abp.AspNetCore.Mvc es el paquete de integracion con AspNet Core MVC para ABP. Siendo asi, instalalo en su proyecto:
````
Install-Package Volo.Abp.AspNetCore.Mvc
````
## Crea el primer modulo ABP
ABP es un marco de referencia modular y require una clase de **inicio (raíz) tipo modulo** derivada de ``AbpModule``:
````C#
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Hosting;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Modularity;
namespace BasicAspNetCoreApplication
{
[DependsOn(typeof(AbpAspNetCoreMvcModule))]
public class AppModule : AbpModule
{
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
// Configura la canalización de peticiones HTTP.
if (env.IsDevelopment())
{
app.UseExceptionHandler("/Error");
// El valor por defecto de HSTS es 30 dias. Debes cambiar esto en ambientes productivos. Referencia https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseConfiguredEndpoints();
}
}
}
````
``AppModule`` es un buen nombre para el modulo de inicio de una aplicacion.
Los paquetes de ABP definen clases de tipo modulo y cada modulo puede depender de otro.
En el codigo anterior, el ``AppModule`` depende de el modulo ``AbpAspNetCoreMvcModule`` (definido por el paquete [Volo.Abp.AspNetCore.Mvc](https://www.nuget.org/packages/Volo.Abp.AspNetCore.Mvc)). Es comun agregar el atributo ``DependsOn`` despues de instalar un paquete ABP nuevo.
En vez de la clase de inicion Startup, estamos configurando una canalizacion de ASP.NET Core en este modulo.
## La clase Program
El proximo paso es modificar la clase Program para integrate el sistema de modulos ABP:
````C#
using BasicAspNetCoreApplication;
var builder = WebApplication.CreateBuilder(args);
await builder.Services.AddApplicationAsync<AppModule>();
var app = builder.Build();
await app.InitializeApplicationAsync();
await app.RunAsync();
````
``builder.Services.AddApplicationAsync<AppModule>();`` Agrega todos los servicios definidos en todos los modulos empezando desde ``AppModule``.
``app.InitializeApplicationAsync()`` inicializa y empieza la aplicacion.
## Ejecutar la Aplicación
Es todo! Ejecuta la aplicación, debe funcionar como esperado.
## Uso de Autofac como Marco de Inyección de Dependencia
Mientras el sistema de Inyección de Dependencia de ASP.NET Core es suficiente para requerimientos basico, [Autofac](https://autofac.org/) proporciona características avanzadas como Inyección de Propiedades e Intercepcion de Metodos, los cuales son necesarios para que ABP pueda llevar a cabo funciones avanzadas.
El acto de remplazar el sistema DI de ASP.NET Core por Autofac e integrarlo con ABP es facil.
1. Instala el paquete [Volo.Abp.Autofac](https://www.nuget.org/packages/Volo.Abp.Autofac)
````
Install-Package Volo.Abp.Autofac
````
2. Agrega la dependencia sobre el modulo ``AbpAutofacModule``
````C#
[DependsOn(typeof(AbpAspNetCoreMvcModule))]
[DependsOn(typeof(AbpAutofacModule))] //Agrega la dependencia sobre el modulo ABP Autofac
public class AppModule : AbpModule
{
...
}
````
3. Actualiza `Program.cs` para que use Autofac:
````C#
using BasicAspNetCoreApplication;
var builder = WebApplication.CreateBuilder(args);
builder.Host.UseAutofac(); //Agrega esta linea
await builder.Services.AddApplicationAsync<AppModule>();
var app = builder.Build();
await app.InitializeApplicationAsync();
await app.RunAsync();
````
## Codigo fuente
Obten el codigo fuente del ejemplo creado en este tutorial de [aqui](https://github.com/abpframework/abp-samples/tree/master/BasicAspNetCoreApplication).

BIN
docs/es/images/create-aspnet-core-application.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

BIN
docs/es/images/create-new-aspnet-core-application-v2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

BIN
docs/es/images/select-empty-web-application-v2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

10
docs/zh-Hans/Background-Jobs-RabbitMq.md

@ -126,25 +126,31 @@ Configure<AbpRabbitMqOptions>(options =>
Configure<AbpRabbitMqBackgroundJobOptions>(options =>
{
options.DefaultQueueNamePrefix = "my_app_jobs.";
options.DefaultDelayedQueueNamePrefix = "my_app_jobs.delayed"
options.PrefetchCount = 1;
options.JobQueues[typeof(EmailSendingArgs)] =
new JobQueueConfiguration(
typeof(EmailSendingArgs),
queueName: "my_app_jobs.emails",
connectionName: "SecondConnection"
connectionName: "SecondConnection",
delayedQueueName:"my_app_jobs.emails.delayed"
);
});
```
- 这个示例将默认的队列名前缀设置为 `my_app_jobs.`,如果多个项目都使用的同一个 RabbitMQ 服务,设置不同的前缀可以避免执行其他项目的后台作业.
- 这个示例将默认的队列名前缀设置为 `my_app_jobs.`并且设置默认的延迟队列名为 `my_app_jobs.delayed`,如果多个项目都使用的同一个 RabbitMQ 服务,设置不同的前缀可以避免执行其他项目的后台作业.
- 设置了预取数量, 用于所有队列.
- 这里还设置了 `EmailSendingArgs` 绑定的 RabbitMQ 连接.
`JobQueueConfiguration` 类的构造函数中,还有一些其他的可选参数.
- `queueName`: 指定后台作业对应的队列名称(全名).
* `DelayedQueueName`: 指定后台延迟执行的作业对于的队列名称(全名).
- `connectionName`: 后台作业对应的 RabbitMQ 连接名称,默认是 `Default`.
- `durable`: 可选参数,默认为 `true`.
- `exclusive`: 可选参数,默认为 `false`.
- `autoDelete`: 可选参数,默认为 `false`.
* `PrefetchCount` (可选参数, 默认为: null)
如果你想要更多地了解 `durable`,`exclusive`,`autoDelete` 的用法,请阅读 RabbitMQ 提供的文档.

3
docs/zh-Hans/Distributed-Event-Bus-RabbitMQ-Integration.md

@ -141,13 +141,14 @@ Configure<AbpRabbitMqOptions>(options =>
});
````
**示例: 配置客户端和交换机名称**
**示例: 配置客户端,交换机名称和预取数量**
````csharp
Configure<AbpRabbitMqEventBusOptions>(options =>
{
options.ClientName = "TestApp1";
options.ExchangeName = "TestMessages";
options.PrefetchCount = 1;
});
````

8
docs/zh-Hans/Object-To-Object-Mapping.md

@ -12,7 +12,7 @@ public class UserAppService : ApplicationService
_userRepository = userRepository;
}
public void CreateUser(CreateUserInput input)
public async Task CreateUser(CreateUserInput input)
{
//Manually creating a User object from the CreateUserInput object
var user = new User
@ -23,7 +23,7 @@ public class UserAppService : ApplicationService
Password = input.Password
};
_userRepository.Insert(user);
await _userRepository.InsertAsync(user);
}
}
```
@ -46,12 +46,12 @@ public class UserAppService : ApplicationService
_userRepository = userRepository;
}
public void CreateUser(CreateUserInput input)
public async Task CreateUser(CreateUserInput input)
{
//Automatically creating a new User object using the CreateUserInput object
var user = ObjectMapper.Map<CreateUserInput, User>(input);
_userRepository.Insert(user);
await _userRepository.InsertAsync(user);
}
}
````

22
docs/zh-Hans/Tutorials/Part-2.md

@ -135,15 +135,15 @@ successfully created the book with id: 439b0ea8-923e-8e1e-5d97-39f2c7ac4246
"CreationTime": "Creation time",
"AreYouSure": "Are you sure?",
"AreYouSureToDelete": "Are you sure you want to delete this item?",
"Enum:BookType:0": "Undefined",
"Enum:BookType:1": "Adventure",
"Enum:BookType:2": "Biography",
"Enum:BookType:3": "Dystopia",
"Enum:BookType:4": "Fantastic",
"Enum:BookType:5": "Horror",
"Enum:BookType:6": "Science",
"Enum:BookType:7": "Science fiction",
"Enum:BookType:8": "Poetry"
"Enum:BookType.Undefined": "Undefined",
"Enum:BookType.Adventure": "Adventure",
"Enum:BookType.Biography": "Biography",
"Enum:BookType.Dystopia": "Dystopia",
"Enum:BookType.Fantastic": "Fantastic",
"Enum:BookType.Horror": "Horror",
"Enum:BookType.Science": "Science",
"Enum:BookType.ScienceFiction": "Science fiction",
"Enum:BookType.Poetry": "Poetry"
}
}
````
@ -152,7 +152,7 @@ successfully created the book with id: 439b0ea8-923e-8e1e-5d97-39f2c7ac4246
* 本地化关键字名称是任意的. 你可以设置任何名称. 对于特定的文本类型,我们更喜欢遵循一些约定:
* 为按钮项添加 `Menu:` 前缀.
* 使用 `Enum:<enum-type>:<enum-value>` 命名约定来本地化枚举成员. 当您这样做时ABP可以在某些适当的情况下自动将枚举本地化.
* 使用 `Enum:<enum-type>:<enum-name>` 或 `<enum-type>.<enum-name>` 或 `<enum-name>` 命名约定来本地化枚举成员. 当您这样做时ABP可以在某些适当的情况下自动将枚举本地化.
如果未在本地化文件中定义文本,则文本将**回退**到本地化键(ASP.NET Core的标准行为).
@ -626,7 +626,7 @@ ABP提供了一个通用的基类,`AbpCrudPageBase<...>`,用来创建CRUD风格
Field="@nameof(BookDto.Type)"
Caption="@L["Type"]">
<DisplayTemplate>
@L[$"Enum:BookType:{(int)context.Type}"]
@L[$"Enum:BookType.{Enum.GetName(context.Type)}"]
</DisplayTemplate>
</DataGridColumn>
<DataGridColumn TItem="BookDto"

10
docs/zh-Hans/Tutorials/Part-3.md

@ -1225,7 +1225,7 @@ delete(id: string) {
@foreach (int bookTypeValue in Enum.GetValues(typeof(BookType)))
{
<SelectItem TValue="BookType" Value="@((BookType) bookTypeValue)">
@L[$"Enum:BookType:{bookTypeValue}"]
@L[$"Enum:BookType.{Enum.GetName((BookType)bookTypeValue)}"]
</SelectItem>
}
</Select>
@ -1323,7 +1323,7 @@ delete(id: string) {
@foreach (int bookTypeValue in Enum.GetValues(typeof(BookType)))
{
<SelectItem TValue="BookType" Value="@((BookType) bookTypeValue)">
@L[$"Enum:BookType:{bookTypeValue}"]
@L[$"Enum:BookType.{Enum.GetName((BookType)bookTypeValue)}"]
</SelectItem>
}
</Select>
@ -1460,7 +1460,7 @@ namespace Acme.BookStore.Blazor
Field="@nameof(BookDto.Type)"
Caption="@L["Type"]">
<DisplayTemplate>
@L[$"Enum:BookType:{(int) context.Type}"]
@L[$"Enum:BookType.{Enum.GetName(context.Type)}"]
</DisplayTemplate>
</DataGridColumn>
<DataGridColumn TItem="BookDto"
@ -1512,7 +1512,7 @@ namespace Acme.BookStore.Blazor
@foreach (int bookTypeValue in Enum.GetValues(typeof(BookType)))
{
<SelectItem TValue="BookType" Value="@((BookType) bookTypeValue)">
@L[$"Enum:BookType:{bookTypeValue}"]
@L[$"Enum:BookType.{Enum.GetName((BookType)bookTypeValue)}"]
</SelectItem>
}
</Select>
@ -1565,7 +1565,7 @@ namespace Acme.BookStore.Blazor
@foreach (int bookTypeValue in Enum.GetValues(typeof(BookType)))
{
<SelectItem TValue="BookType" Value="@((BookType) bookTypeValue)">
@L[$"Enum:BookType:{bookTypeValue}"]
@L[$"Enum:BookType.{Enum.GetName((BookType)bookTypeValue)}"]
</SelectItem>
}
</Select>

5
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/PageToolbars/PageToolbarManager.cs

@ -3,16 +3,17 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AspNetCore.Components.Web.Theming.PageToolbars;
public class PageToolbarManager : IPageToolbarManager, ITransientDependency
{
protected IHybridServiceScopeFactory ServiceScopeFactory { get; }
protected IServiceScopeFactory ServiceScopeFactory { get; }
public PageToolbarManager(
IHybridServiceScopeFactory serviceScopeFactory)
IServiceScopeFactory serviceScopeFactory)
{
ServiceScopeFactory = serviceScopeFactory;
}

1
framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationLocalizationConfigurationDto.cs

@ -7,7 +7,6 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations;
[Serializable]
public class ApplicationLocalizationConfigurationDto
{
//TODO: Rename to Texts?
public Dictionary<string, Dictionary<string, string>> Values { get; set; }
public List<LanguageInfo> Languages { get; set; }

5
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/PageToolbars/PageToolbarManager.cs

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Volo.Abp.DependencyInjection;
@ -10,11 +11,11 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.PageToolbars;
public class PageToolbarManager : IPageToolbarManager, ITransientDependency
{
protected AbpPageToolbarOptions Options { get; }
protected IHybridServiceScopeFactory ServiceScopeFactory { get; }
protected IServiceScopeFactory ServiceScopeFactory { get; }
public PageToolbarManager(
IOptions<AbpPageToolbarOptions> options,
IHybridServiceScopeFactory serviceScopeFactory)
IServiceScopeFactory serviceScopeFactory)
{
Options = options.Value;
ServiceScopeFactory = serviceScopeFactory;

2
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ExceptionHandling/AbpExceptionFilter.cs

@ -20,7 +20,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ExceptionHandling;
public class AbpExceptionFilter : IAsyncExceptionFilter, ITransientDependency
{
public async Task OnExceptionAsync(ExceptionContext context)
public virtual async Task OnExceptionAsync(ExceptionContext context)
{
if (!ShouldHandleException(context))
{

2
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ExceptionHandling/AbpExceptionPageFilter.cs

@ -25,7 +25,7 @@ public class AbpExceptionPageFilter : IAsyncPageFilter, ITransientDependency
return Task.CompletedTask;
}
public async Task OnPageHandlerExecutionAsync(PageHandlerExecutingContext context, PageHandlerExecutionDelegate next)
public virtual async Task OnPageHandlerExecutionAsync(PageHandlerExecutingContext context, PageHandlerExecutionDelegate next)
{
if (context.HandlerMethod == null || !ShouldHandleException(context))
{

52
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/DependencyInjection/HttpContextServiceScopeFactory.cs

@ -1,52 +0,0 @@
using System;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AspNetCore.DependencyInjection;
[ExposeServices(
typeof(IHybridServiceScopeFactory),
typeof(HttpContextServiceScopeFactory)
)]
[Dependency(ReplaceServices = true)]
public class HttpContextServiceScopeFactory : IHybridServiceScopeFactory, ITransientDependency
{
protected IHttpContextAccessor HttpContextAccessor { get; }
protected IServiceScopeFactory ServiceScopeFactory { get; }
public HttpContextServiceScopeFactory(
IHttpContextAccessor httpContextAccessor,
IServiceScopeFactory serviceScopeFactory)
{
HttpContextAccessor = httpContextAccessor;
ServiceScopeFactory = serviceScopeFactory;
}
public virtual IServiceScope CreateScope()
{
var httpContext = HttpContextAccessor.HttpContext;
if (httpContext == null)
{
return ServiceScopeFactory.CreateScope();
}
return new NonDisposedHttpContextServiceScope(httpContext.RequestServices);
}
protected class NonDisposedHttpContextServiceScope : IServiceScope
{
public IServiceProvider ServiceProvider { get; }
public NonDisposedHttpContextServiceScope(IServiceProvider serviceProvider)
{
ServiceProvider = serviceProvider;
}
public void Dispose()
{
}
}
}

4
framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IDeletionAuditedObject.cs

@ -10,7 +10,7 @@ public interface IDeletionAuditedObject : IHasDeletionTime
/// <summary>
/// Id of the deleter user.
/// </summary>
Guid? DeleterId { get; set; }
Guid? DeleterId { get; }
}
/// <summary>
@ -22,5 +22,5 @@ public interface IDeletionAuditedObject<TUser> : IDeletionAuditedObject
/// <summary>
/// Reference to the deleter user.
/// </summary>
TUser Deleter { get; set; }
TUser Deleter { get; }
}

2
framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IHasDeletionTime.cs

@ -11,5 +11,5 @@ public interface IHasDeletionTime : ISoftDelete
/// <summary>
/// Deletion time.
/// </summary>
DateTime? DeletionTime { get; set; }
DateTime? DeletionTime { get; }
}

2
framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IHasModificationTime.cs

@ -10,5 +10,5 @@ public interface IHasModificationTime
/// <summary>
/// The last modified time for this entity.
/// </summary>
DateTime? LastModificationTime { get; set; }
DateTime? LastModificationTime { get; }
}

4
framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IModificationAuditedObject.cs

@ -10,7 +10,7 @@ public interface IModificationAuditedObject : IHasModificationTime
/// <summary>
/// Last modifier user for this entity.
/// </summary>
Guid? LastModifierId { get; set; }
Guid? LastModifierId { get; }
}
/// <summary>
@ -22,5 +22,5 @@ public interface IModificationAuditedObject<TUser> : IModificationAuditedObject
/// <summary>
/// Reference to the last modifier user of this entity.
/// </summary>
TUser LastModifier { get; set; }
TUser LastModifier { get; }
}

16
framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditPropertySetter.cs

@ -99,7 +99,7 @@ public class AuditPropertySetter : IAuditPropertySetter, ITransientDependency
{
if (targetObject is IHasModificationTime objectWithModificationTime)
{
objectWithModificationTime.LastModificationTime = Clock.Now;
ObjectHelper.TrySetProperty(objectWithModificationTime, x => x.LastModificationTime, () => Clock.Now);
}
}
@ -112,7 +112,7 @@ public class AuditPropertySetter : IAuditPropertySetter, ITransientDependency
if (!CurrentUser.Id.HasValue)
{
modificationAuditedObject.LastModifierId = null;
ObjectHelper.TrySetProperty(modificationAuditedObject, x => x.LastModifierId, () => null);
return;
}
@ -120,7 +120,7 @@ public class AuditPropertySetter : IAuditPropertySetter, ITransientDependency
{
if (multiTenantEntity.TenantId != CurrentUser.TenantId)
{
modificationAuditedObject.LastModifierId = null;
ObjectHelper.TrySetProperty(modificationAuditedObject, x => x.LastModifierId, () => null);
return;
}
}
@ -134,7 +134,7 @@ public class AuditPropertySetter : IAuditPropertySetter, ITransientDependency
}
*/
modificationAuditedObject.LastModifierId = CurrentUser.Id;
ObjectHelper.TrySetProperty(modificationAuditedObject, x => x.LastModifierId, () => CurrentUser.Id);
}
protected virtual void SetDeletionTime(object targetObject)
@ -143,7 +143,7 @@ public class AuditPropertySetter : IAuditPropertySetter, ITransientDependency
{
if (objectWithDeletionTime.DeletionTime == null)
{
objectWithDeletionTime.DeletionTime = Clock.Now;
ObjectHelper.TrySetProperty(objectWithDeletionTime, x => x.DeletionTime, () => Clock.Now);
}
}
}
@ -162,7 +162,7 @@ public class AuditPropertySetter : IAuditPropertySetter, ITransientDependency
if (!CurrentUser.Id.HasValue)
{
deletionAuditedObject.DeleterId = null;
ObjectHelper.TrySetProperty(deletionAuditedObject, x => x.DeleterId, () => null);
return;
}
@ -170,11 +170,11 @@ public class AuditPropertySetter : IAuditPropertySetter, ITransientDependency
{
if (multiTenantEntity.TenantId != CurrentUser.TenantId)
{
deletionAuditedObject.DeleterId = null;
ObjectHelper.TrySetProperty(deletionAuditedObject, x => x.DeleterId, () => null);
return;
}
}
deletionAuditedObject.DeleterId = CurrentUser.Id;
ObjectHelper.TrySetProperty(deletionAuditedObject, x => x.DeleterId, () => CurrentUser.Id);
}
}

6
framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionDefinition.cs

@ -30,7 +30,7 @@ public class PermissionDefinition : IHasSimpleStateCheckers<PermissionDefinition
/// A list of allowed providers to get/set value of this permission.
/// An empty list indicates that all providers are allowed.
/// </summary>
public List<string> Providers { get; } //TODO: Rename to AllowedProviders?
public List<string> Providers { get; }
public List<ISimpleStateChecker<PermissionDefinition>> StateCheckers { get; }
@ -122,14 +122,14 @@ public class PermissionDefinition : IHasSimpleStateCheckers<PermissionDefinition
}
/// <summary>
/// Set the <see cref="StateProviders"/> property.
/// Adds one or more providers to the <see cref="Providers"/> list.
/// This is a shortcut for nested calls on this object.
/// </summary>
public virtual PermissionDefinition WithProviders(params string[] providers)
{
if (!providers.IsNullOrEmpty())
{
Providers.AddRange(providers);
Providers.AddIfNotContains(providers);
}
return this;

2
framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/AbpRabbitMqBackgroundJobOptions.cs

@ -19,6 +19,8 @@ public class AbpRabbitMqBackgroundJobOptions
/// Default value: "AbpBackgroundJobsDelayed."
/// </summary>
public string DefaultDelayedQueueNamePrefix { get; set; }
public ushort? PrefetchCount { get; set; }
public AbpRabbitMqBackgroundJobOptions()
{

10
framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueue.cs

@ -66,7 +66,8 @@ public class JobQueue<TArgs> : IJobQueue<TArgs>
new JobQueueConfiguration(
typeof(TArgs),
AbpRabbitMqBackgroundJobOptions.DefaultQueueNamePrefix + JobConfiguration.JobName,
AbpRabbitMqBackgroundJobOptions.DefaultDelayedQueueNamePrefix + JobConfiguration.JobName
AbpRabbitMqBackgroundJobOptions.DefaultDelayedQueueNamePrefix + JobConfiguration.JobName,
prefetchCount: AbpRabbitMqBackgroundJobOptions.PrefetchCount
);
}
@ -140,9 +141,14 @@ public class JobQueue<TArgs> : IJobQueue<TArgs>
if (AbpBackgroundJobOptions.IsJobExecutionEnabled)
{
if (QueueConfiguration.PrefetchCount.HasValue)
{
ChannelAccessor.Channel.BasicQos(0, QueueConfiguration.PrefetchCount.Value, false);
}
Consumer = new AsyncEventingBasicConsumer(ChannelAccessor.Channel);
Consumer.Received += MessageReceived;
//TODO: What BasicConsume returns?
ChannelAccessor.Channel.BasicConsume(
queue: QueueConfiguration.QueueName,

6
framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueueConfiguration.cs

@ -20,12 +20,14 @@ public class JobQueueConfiguration : QueueDeclareConfiguration
string connectionName = null,
bool durable = true,
bool exclusive = false,
bool autoDelete = false)
bool autoDelete = false,
ushort? prefetchCount = null)
: base(
queueName,
durable,
exclusive,
autoDelete)
autoDelete,
prefetchCount)
{
JobArgsType = jobArgsType;
ConnectionName = connectionName;

15
framework/src/Volo.Abp.BlazoriseUI/AbpBlazoriseUiModalExtensions.cs

@ -0,0 +1,15 @@
using System.Threading.Tasks;
using Blazorise;
namespace Volo.Abp.BlazoriseUI;
public static class AbpBlazoriseUiModalExtensions
{
public static Task CancelClosingModalWhenFocusLost(this Modal modal, ModalClosingEventArgs eventArgs)
{
// cancel close if clicked outside of modal area
eventArgs.Cancel = eventArgs.CloseReason == CloseReason.FocusLostClosing;
return Task.CompletedTask;
}
}

4
framework/src/Volo.Abp.Caching/Volo/Abp/Caching/DistributedCache.cs

@ -20,7 +20,9 @@ namespace Volo.Abp.Caching;
/// Represents a distributed cache of <typeparamref name="TCacheItem" /> type.
/// </summary>
/// <typeparam name="TCacheItem">The type of cache item being cached.</typeparam>
public class DistributedCache<TCacheItem> : DistributedCache<TCacheItem, string>, IDistributedCache<TCacheItem>
public class DistributedCache<TCacheItem> :
DistributedCache<TCacheItem, string>,
IDistributedCache<TCacheItem>
where TCacheItem : class
{
public DistributedCache(

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

@ -1,4 +1,5 @@
using System.Text;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Volo.Abp.Cli.ServiceProxying;
using Volo.Abp.DependencyInjection;
@ -13,7 +14,7 @@ public class GenerateProxyCommand : ProxyCommandBase<GenerateProxyCommand>
public GenerateProxyCommand(
IOptions<AbpCliServiceProxyOptions> serviceProxyOptions,
IHybridServiceScopeFactory serviceScopeFactory)
IServiceScopeFactory serviceScopeFactory)
: base(serviceProxyOptions, serviceScopeFactory)
{
}

108
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs

@ -103,12 +103,18 @@ public abstract class ProjectCreationCommandBase
Logger.LogInformation("UI Framework: " + uiFramework);
}
var theme = uiFramework == UiFramework.None ? (Theme?)null : GetTheme(commandLineArgs);
var theme = uiFramework == UiFramework.None ? (Theme?)null : GetThemeByTemplateOrNull(commandLineArgs, template);
if (theme.HasValue)
{
Logger.LogInformation("Theme: " + theme);
}
var themeStyle = theme.HasValue ? GetThemeStyleOrNull(commandLineArgs, theme.Value) : (ThemeStyle?)null;
if(themeStyle.HasValue)
{
Logger.LogInformation("Theme Style: " + themeStyle);
}
var publicWebSite = uiFramework != UiFramework.None && commandLineArgs.Options.ContainsKey(Options.PublicWebSite.Long);
if (publicWebSite)
{
@ -221,7 +227,8 @@ public abstract class ProjectCreationCommandBase
commandLineArgs.Options,
connectionString,
pwa,
theme
theme,
themeStyle
);
}
@ -360,7 +367,7 @@ public abstract class ProjectCreationCommandBase
return DatabaseProvider.MongoDb;
}
throw new CliUsageException("The option you provided for Database Provider is invalid!");
throw new CliUsageException(ExceptionMessageHelper.GetInvalidOptionExceptionMessage("Database Provider"));
}
protected virtual async Task RunGraphBuildForMicroserviceServiceTemplate(ProjectBuildArgs projectArgs)
@ -471,7 +478,7 @@ public abstract class ProjectCreationCommandBase
case "oracle":
return DatabaseManagementSystem.Oracle;
default:
throw new CliUsageException("The option you provided for Database Management System is invalid!");
throw new CliUsageException(ExceptionMessageHelper.GetInvalidOptionExceptionMessage("Database Management System"));
}
}
@ -487,7 +494,7 @@ public abstract class ProjectCreationCommandBase
case "react-native":
return MobileApp.ReactNative;
default:
throw new CliUsageException("The option you provided for Mobile App is invalid!");
throw new CliUsageException(ExceptionMessageHelper.GetInvalidOptionExceptionMessage("Mobile App"));
}
}
@ -515,23 +522,59 @@ public abstract class ProjectCreationCommandBase
case "blazor-server":
return UiFramework.BlazorServer;
default:
throw new CliUsageException("The option you provided for UI Framework is invalid!");
throw new CliUsageException(ExceptionMessageHelper.GetInvalidOptionExceptionMessage("UI Framework"));
}
}
protected virtual Theme GetTheme(CommandLineArgs commandLineArgs)
protected virtual Theme? GetThemeByTemplateOrNull(CommandLineArgs commandLineArgs, string template = "app")
{
var optionValue = commandLineArgs.Options.GetOrNull(Options.Theme.Long);
switch (optionValue)
var theme = commandLineArgs.Options.GetOrNull(Options.Theme.Long)?.ToLower();
return template switch
{
case null:
case "leptonx-lite":
return Theme.LeptonXLite;
case "basic":
return Theme.Basic;
default:
throw new CliUsageException("The option you provided for Theme is invalid!");
AppTemplate.TemplateName or AppNoLayersTemplate.TemplateName => GetAppTheme(),
AppProTemplate.TemplateName or AppNoLayersProTemplate.TemplateName or MicroserviceProTemplate.TemplateName => GetAppProTheme(),
_ => null
};
Theme GetAppTheme()
{
return theme switch
{
// null or "leptonx-lite" => Theme.LeptonXLite,
"basic" => Theme.Basic,
_ => Theme.LeptonXLite
};
}
Theme GetAppProTheme()
{
return theme switch
{
// null or "leptonx" => Theme.LeptonX,
"lepton" => Theme.Lepton,
"basic" => Theme.Basic,
_ => Theme.LeptonX //TODO: default???
};
}
}
protected virtual ThemeStyle? GetThemeStyleOrNull(CommandLineArgs commandLineArgs, Theme theme)
{
if(theme != Theme.LeptonX)
{
return null;
}
var themeStyle = commandLineArgs.Options.GetOrNull(Options.ThemeStyle.Long)?.ToLower();
return themeStyle switch
{
// null => ThemeStyle.NotSpecified, TODO: remove it!!!
"dim" or null => ThemeStyle.Dim,
"light" => ThemeStyle.Light,
"dark" => ThemeStyle.Dark,
_ => null
};
}
protected void ConfigureNpmPackagesForTheme(ProjectBuildArgs projectArgs)
@ -546,6 +589,15 @@ public abstract class ProjectCreationCommandBase
case Theme.Basic:
ConfigureNpmPackagesForBasicTheme(projectArgs);
break;
case Theme.Lepton:
ConfigureNpmPackagesForLeptonTheme(projectArgs);
break;
case Theme.NotSpecified:
case Theme.LeptonXLite:
case Theme.LeptonX:
break;
default:
throw new CliUsageException(ExceptionMessageHelper.GetInvalidOptionExceptionMessage(Options.Theme.Long));
}
}
@ -566,6 +618,25 @@ public abstract class ProjectCreationCommandBase
ThemePackageAdder.AddAngularPackage(projectArgs.OutputFolder, "@abp/ng.theme.basic", projectArgs.Version);
}
}
private void ConfigureNpmPackagesForLeptonTheme(ProjectBuildArgs projectArgs)
{
if (projectArgs.UiFramework is not UiFramework.None or UiFramework.Angular)
{
ThemePackageAdder.AddNpmPackage(projectArgs.OutputFolder, "@volo/abp.aspnetcore.mvc.ui.theme.lepton", projectArgs.Version);
}
if (projectArgs.UiFramework is UiFramework.BlazorServer)
{
ThemePackageAdder.AddNpmPackage(projectArgs.OutputFolder, "@volo/abp.aspnetcore.components.server.leptontheme", projectArgs.Version);
ThemePackageAdder.AddNpmPackage(projectArgs.OutputFolder, "@volo/abp.aspnetcore.mvc.ui.theme.lepton", projectArgs.Version);
}
if (projectArgs.UiFramework is UiFramework.Angular)
{
ThemePackageAdder.AddAngularPackage(projectArgs.OutputFolder, "@volo/abp.ng.theme.lepton", projectArgs.Version);
}
}
public static class Options
{
@ -669,5 +740,10 @@ public abstract class ProjectCreationCommandBase
{
public const string Long = "theme";
}
public static class ThemeStyle
{
public const string Long = "theme-style";
}
}
}

5
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProxyCommandBase.cs

@ -2,6 +2,7 @@
using System.IO;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
@ -19,11 +20,11 @@ public abstract class ProxyCommandBase<T> : IConsoleCommand, ITransientDependenc
protected AbpCliServiceProxyOptions ServiceProxyOptions { get; }
protected IHybridServiceScopeFactory ServiceScopeFactory { get; }
protected IServiceScopeFactory ServiceScopeFactory { get; }
public ProxyCommandBase(
IOptions<AbpCliServiceProxyOptions> serviceProxyOptions,
IHybridServiceScopeFactory serviceScopeFactory)
IServiceScopeFactory serviceScopeFactory)
{
ServiceScopeFactory = serviceScopeFactory;
ServiceProxyOptions = serviceProxyOptions.Value;

3
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/RemoveProxyCommand.cs

@ -1,4 +1,5 @@
using System.Text;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Volo.Abp.Cli.ServiceProxying;
using Volo.Abp.DependencyInjection;
@ -13,7 +14,7 @@ public class RemoveProxyCommand : ProxyCommandBase<RemoveProxyCommand>
public RemoveProxyCommand(
IOptions<AbpCliServiceProxyOptions> serviceProxyOptions,
IHybridServiceScopeFactory serviceScopeFactory)
IServiceScopeFactory serviceScopeFactory)
: base(serviceProxyOptions, serviceScopeFactory)
{
}

997
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStep.cs

File diff suppressed because it is too large

76
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStyleStep.cs

@ -0,0 +1,76 @@
using System.Collections.Generic;
using System.Linq;
namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps;
public class ChangeThemeStyleStep : ProjectBuildPipelineStep
{
public override void Execute(ProjectBuildContext context)
{
if (context.BuildArgs.Theme != Theme.LeptonX)
{
return;
}
switch (context.BuildArgs.ThemeStyle)
{
case ThemeStyle.Light:
ChangeThemeStyle(context, themeStyleName: "Light");
break;
case ThemeStyle.Dark:
ChangeThemeStyle(context, themeStyleName: "Dark");
break;
}
}
private void ChangeThemeStyle(ProjectBuildContext context, string themeStyleName)
{
var defaultThemeStyleName = "LeptonXStyleNames.Dim";
var newThemeStyleName = $"LeptonXStyleNames.{themeStyleName}";
var filePaths = new List<string>
{
"/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs",
"/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs",
"/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs",
"/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs",
"/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorModule.cs",
"/MyCompanyName.MyProjectName.Blazor.Server/MyProjectNameBlazorModule.cs",
"/MyCompanyName.MyProjectName.Blazor.Server/MyProjectNameModule.cs",
"/MyCompanyName.MyProjectName.Blazor.Server.Mongo/MyProjectNameModule.cs",
"/MyCompanyName.MyProjectName.Host/MyProjectNameModule.cs",
"/MyCompanyName.MyProjectName.Host.Mongo/MyProjectNameModule.cs",
"/MyCompanyName.MyProjectName.Mvc/MyProjectNameModule.cs",
"/MyCompanyName.MyProjectName.Mvc.Mongo/MyProjectNameModule.cs",
"/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyProjectNameBlazorModule.cs",
"/MyCompanyName.MyProjectName.AuthServer/MyProjectNameAuthServerModule.cs",
};
foreach(var filePath in filePaths)
{
ChangeThemeStyleName(context, filePath, defaultThemeStyleName, newThemeStyleName);
}
}
protected void ChangeThemeStyleName(ProjectBuildContext context, string filePath, string oldThemeStyleName, string newThemeStyleName)
{
var file = context.Files.FirstOrDefault(x => x.Name.Contains(filePath));
if (file == null)
{
return;
}
file.NormalizeLineEndings();
var lines = file.GetLines();
for (var i = 0; i < lines.Length; i++)
{
if (lines[i].Contains(oldThemeStyleName))
{
lines[i] = lines[i].Replace(oldThemeStyleName, newThemeStyleName);
}
}
file.SetLines(lines);
}
}

2
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveDependencyFromPackageJsonFileStep.cs

@ -17,7 +17,7 @@ public class RemoveDependencyFromPackageJsonFileStep : ProjectBuildPipelineStep
public override void Execute(ProjectBuildContext context)
{
var packageJsonFile = context.Files.FirstOrDefault(f => f.Name == _packageJsonFilePath);
var packageJsonFile = context.Files.FirstOrDefault(f => f.Name.Contains(_packageJsonFilePath));
if (packageJsonFile == null)
{

9
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Theme.cs

@ -1,7 +1,10 @@
namespace Volo.Abp.Cli.ProjectBuilding.Building;
public enum Theme
public enum Theme : byte
{
LeptonXLite = 0,
Basic = 1
NotSpecified = 0,
Basic = 1,
Lepton = 2,
LeptonXLite = 3,
LeptonX = 4
}

8
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/ThemeStyle.cs

@ -0,0 +1,8 @@
namespace Volo.Abp.Cli.ProjectBuilding.Building;
public enum ThemeStyle : byte
{
NotSpecified = 0,
Dim = 1,
Light = 2,
Dark = 3
}

6
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ProjectBuildArgs.cs

@ -44,6 +44,8 @@ public class ProjectBuildArgs
public Theme? Theme { get; set; }
public ThemeStyle? ThemeStyle { get; set; }
[NotNull]
public Dictionary<string, string> ExtraProperties { get; set; }
@ -63,7 +65,8 @@ public class ProjectBuildArgs
Dictionary<string, string> extraProperties = null,
[CanBeNull] string connectionString = null,
bool pwa = false,
Theme? theme = null)
Theme? theme = null,
ThemeStyle? themeStyle = null)
{
SolutionName = Check.NotNull(solutionName, nameof(solutionName));
TemplateName = templateName;
@ -81,5 +84,6 @@ public class ProjectBuildArgs
ConnectionString = connectionString;
Pwa = pwa;
Theme = theme;
ThemeStyle = themeStyle;
}
}

6
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppNoLayersProTemplate.cs

@ -1,4 +1,6 @@
namespace Volo.Abp.Cli.ProjectBuilding.Templates.App;
using Volo.Abp.Cli.ProjectBuilding.Building;
namespace Volo.Abp.Cli.ProjectBuilding.Templates.App;
public class AppNoLayersProTemplate : AppNoLayersTemplateBase
{
@ -6,6 +8,8 @@ public class AppNoLayersProTemplate : AppNoLayersTemplateBase
/// "app-nolayers-pro".
/// </summary>
public const string TemplateName = "app-nolayers-pro";
public const Theme DefaultTheme = Theme.LeptonX;
public AppNoLayersProTemplate()
: base(TemplateName)

6
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppNoLayersTemplate.cs

@ -1,4 +1,6 @@
namespace Volo.Abp.Cli.ProjectBuilding.Templates.App;
using Volo.Abp.Cli.ProjectBuilding.Building;
namespace Volo.Abp.Cli.ProjectBuilding.Templates.App;
public class AppNoLayersTemplate : AppNoLayersTemplateBase
{
@ -7,6 +9,8 @@ public class AppNoLayersTemplate : AppNoLayersTemplateBase
/// </summary>
public const string TemplateName = "app-nolayers";
public const Theme DefaultTheme = Theme.LeptonXLite;
public AppNoLayersTemplate()
: base(TemplateName)
{

6
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppProTemplate.cs

@ -1,4 +1,6 @@
namespace Volo.Abp.Cli.ProjectBuilding.Templates.App;
using Volo.Abp.Cli.ProjectBuilding.Building;
namespace Volo.Abp.Cli.ProjectBuilding.Templates.App;
public class AppProTemplate : AppTemplateBase
{
@ -6,6 +8,8 @@ public class AppProTemplate : AppTemplateBase
/// "app-pro".
/// </summary>
public const string TemplateName = "app-pro";
public const Theme DefaultTheme = Theme.LeptonX;
public AppProTemplate()
: base(TemplateName)

6
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplate.cs

@ -1,4 +1,6 @@
namespace Volo.Abp.Cli.ProjectBuilding.Templates.App;
using Volo.Abp.Cli.ProjectBuilding.Building;
namespace Volo.Abp.Cli.ProjectBuilding.Templates.App;
public class AppTemplate : AppTemplateBase
{
@ -6,6 +8,8 @@ public class AppTemplate : AppTemplateBase
/// "app".
/// </summary>
public const string TemplateName = "app";
public const Theme DefaultTheme = Theme.LeptonXLite;
public AppTemplate()
: base(TemplateName)

89
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs

@ -1,9 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using NuGet.Versioning;
using Volo.Abp.Cli.Commands;
using Volo.Abp.Cli.ProjectBuilding.Building;
using Volo.Abp.Cli.ProjectBuilding.Building.Steps;
using Volo.Abp.Cli.ProjectBuilding.Templates.Microservice;
namespace Volo.Abp.Cli.ProjectBuilding.Templates.App;
@ -183,55 +185,76 @@ public abstract class AppTemplateBase : TemplateInfo
{
return;
}
if (context.BuildArgs.Theme != Theme.LeptonXLite)
if (context.BuildArgs.Theme == Theme.LeptonX)
{
context.Symbols.Add("LEPTONX");
steps.Add(new ChangeThemeStyleStep());
}
if (IsDefaultThemeForTemplate(context.BuildArgs.Theme.Value))
{
steps.Add(new ChangeThemeStep());
RemoveLeptonXThemePackagesFromPackageJsonFiles(steps);
return;
}
steps.Add(new ChangeThemeStep());
RemoveLeptonXThemePackagesFromPackageJsonFiles(steps, isProTemplate: IsPro());
}
private void RemoveLeptonXThemePackagesFromPackageJsonFiles(List<ProjectBuildPipelineStep> steps)
private static bool IsDefaultThemeForTemplate(Theme theme)
{
var defaultThemesForTemplates = new[]
{
AppTemplate.DefaultTheme, AppProTemplate.DefaultTheme,
AppNoLayersTemplate.DefaultTheme, AppNoLayersProTemplate.DefaultTheme
};
return defaultThemesForTemplates.Any(defaultTheme => defaultTheme == theme);
}
private static void RemoveLeptonXThemePackagesFromPackageJsonFiles(List<ProjectBuildPipelineStep> steps, bool isProTemplate)
{
var packageJsonFilePaths = new List<string>()
{
"/aspnet-core/src/MyCompanyName.MyProjectName.Web/package.json",
"/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/package.json",
"/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/package.json",
"/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/package.json",
"/aspnet-core/MyCompanyName.MyProjectName.Mvc/package.json",
"/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/package.json",
"/aspnet-core/MyCompanyName.MyProjectName.Host/package.json",
"/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/package.json",
var packageJsonFilePaths = new List<string>
{
"/MyCompanyName.MyProjectName.Web/package.json",
"/MyCompanyName.MyProjectName.Web.Host/package.json",
"/MyCompanyName.MyProjectName.HttpApi.HostWithIds/package.json",
"/MyCompanyName.MyProjectName.AuthServer/package.json",
"/MyCompanyName.MyProjectName/package.json",
"/MyCompanyName.MyProjectName.Host/package.json",
"/MyCompanyName.MyProjectName.Host.Mongo/package.json"
};
var blazorServerPackageJsonFilePaths = new List<string>()
var blazorServerPackageJsonFilePaths = new List<string>
{
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/package.json",
"/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/package.json",
"/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/package.json",
"/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/package.json"
"/MyCompanyName.MyProjectName.Blazor.Server/package.json",
"/MyCompanyName.MyProjectName.Blazor.Server.Tiered/package.json",
"/MyCompanyName.MyProjectName.Blazor.Server.Mongo/package.json"
};
var angularPackageJsonFilePaths = new List<string>()
var angularPackageJsonFilePaths = new List<string>
{
"/angular/package.json"
};
var mvcUiPackageName = isProTemplate ? "@volo/abp.aspnetcore.mvc.ui.theme.leptonx" : "@abp/aspnetcore.mvc.ui.theme.leptonxlite";
var blazorServerUiPackageName = isProTemplate ? "@volo/aspnetcore.components.server.leptonxtheme" : "@abp/aspnetcore.components.server.leptonxlitetheme";
var ngUiPackageName = isProTemplate ? "@volosoft/abp.ng.theme.lepton-x" : "@abp/ng.theme.lepton-x";
foreach (var packageJsonFilePath in packageJsonFilePaths)
{
steps.Add(new RemoveDependencyFromPackageJsonFileStep(packageJsonFilePath, "@abp/aspnetcore.mvc.ui.theme.leptonxlite"));
steps.Add(new RemoveDependencyFromPackageJsonFileStep(packageJsonFilePath, mvcUiPackageName));
}
foreach (var blazorServerPackageJsonFilePath in blazorServerPackageJsonFilePaths)
{
steps.Add(new RemoveDependencyFromPackageJsonFileStep(blazorServerPackageJsonFilePath, "@abp/aspnetcore.mvc.ui.theme.leptonxlite"));
steps.Add(new RemoveDependencyFromPackageJsonFileStep(blazorServerPackageJsonFilePath, "@abp/aspnetcore.components.server.leptonxlitetheme"));
steps.Add(new RemoveDependencyFromPackageJsonFileStep(blazorServerPackageJsonFilePath, mvcUiPackageName));
steps.Add(new RemoveDependencyFromPackageJsonFileStep(blazorServerPackageJsonFilePath, blazorServerUiPackageName));
}
foreach (var angularPackageJsonFilePath in angularPackageJsonFilePaths)
{
steps.Add(new RemoveDependencyFromPackageJsonFileStep(angularPackageJsonFilePath, "@abp/ng.theme.lepton-x"));
steps.Add(new RemoveDependencyFromPackageJsonFileStep(angularPackageJsonFilePath, ngUiPackageName));
steps.Add(new RemoveDependencyFromPackageJsonFileStep(angularPackageJsonFilePath, "bootstrap-icons"));
}
}
@ -548,27 +571,41 @@ public abstract class AppTemplateBase : TemplateInfo
{
case UiFramework.None:
steps.Add(new RemoveFileStep("/aspnet-core/etc/docker/docker-compose.Blazor.yml"));
steps.Add(new RemoveFileStep("/aspnet-core/etc/docker/docker-compose.Blazor.Server.yml"));
steps.Add(new RemoveFileStep("/aspnet-core/etc/docker/docker-compose.Mvc.yml"));
steps.Add(new RemoveFileStep("/aspnet-core/etc/docker/dynamic-env.json"));
steps.Add(new RemoveFileStep("/aspnet-core/etc/docker/appsettings.json"));
steps.Add(new MoveFileStep("/aspnet-core/etc/docker/docker-compose.Angular.yml", "/aspnet-core/etc/docker/docker-compose.yml"));
break;
case UiFramework.Angular:
steps.Add(new RemoveFileStep("/aspnet-core/etc/docker/docker-compose.Blazor.yml"));
steps.Add(new RemoveFileStep("/aspnet-core/etc/docker/docker-compose.Blazor.Server.yml"));
steps.Add(new RemoveFileStep("/aspnet-core/etc/docker/docker-compose.Mvc.yml"));
steps.Add(new RemoveFileStep("/aspnet-core/etc/docker/appsettings.json"));
steps.Add(new MoveFileStep("/aspnet-core/etc/docker/docker-compose.Angular.yml", "/aspnet-core/etc/docker/docker-compose.yml"));
break;
case UiFramework.Blazor:
case UiFramework.BlazorServer:
steps.Add(new RemoveFileStep("/aspnet-core/etc/docker/docker-compose.Angular.yml"));
steps.Add(new RemoveFileStep("/aspnet-core/etc/docker/docker-compose.Blazor.Server.yml"));
steps.Add(new RemoveFileStep("/aspnet-core/etc/docker/docker-compose.Mvc.yml"));
steps.Add(new RemoveFileStep("/aspnet-core/etc/docker/dynamic-env.json"));
steps.Add(new MoveFileStep("/aspnet-core/etc/docker/docker-compose.Blazor.yml", "/aspnet-core/etc/docker/docker-compose.yml"));
break;
case UiFramework.BlazorServer:
steps.Add(new RemoveFileStep("/aspnet-core/etc/docker/docker-compose.Angular.yml"));
steps.Add(new RemoveFileStep("/aspnet-core/etc/docker/docker-compose.Mvc.yml"));
steps.Add(new RemoveFileStep("/aspnet-core/etc/docker/docker-compose.Blazor.yml"));
steps.Add(new RemoveFileStep("/aspnet-core/etc/docker/dynamic-env.json"));
steps.Add(new RemoveFileStep("/aspnet-core/etc/docker/appsettings.json"));
steps.Add(new MoveFileStep("/aspnet-core/etc/docker/docker-compose.Blazor.Server.yml", "/aspnet-core/etc/docker/docker-compose.yml"));
break;
case UiFramework.NotSpecified:
case UiFramework.Mvc:
steps.Add(new RemoveFileStep("/aspnet-core/etc/docker/docker-compose.Blazor.yml"));
steps.Add(new RemoveFileStep("/aspnet-core/etc/docker/docker-compose.Blazor.Server.yml"));
steps.Add(new RemoveFileStep("/aspnet-core/etc/docker/docker-compose.Angular.yml"));
steps.Add(new RemoveFileStep("/aspnet-core/etc/docker/dynamic-env.json"));
steps.Add(new RemoveFileStep("/aspnet-core/etc/docker/appsettings.json"));
steps.Add(new MoveFileStep("/aspnet-core/etc/docker/docker-compose.Mvc.yml", "/aspnet-core/etc/docker/docker-compose.yml"));
break;
}

6
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceProTemplate.cs

@ -1,4 +1,6 @@
namespace Volo.Abp.Cli.ProjectBuilding.Templates.Microservice;
using Volo.Abp.Cli.ProjectBuilding.Building;
namespace Volo.Abp.Cli.ProjectBuilding.Templates.Microservice;
public class MicroserviceProTemplate : MicroserviceTemplateBase
{
@ -7,6 +9,8 @@ public class MicroserviceProTemplate : MicroserviceTemplateBase
/// </summary>
public const string TemplateName = "microservice-pro";
public const Theme DefaultTheme = Theme.LeptonX;
public MicroserviceProTemplate()
: base(TemplateName)
{

59
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceTemplateBase.cs

@ -24,9 +24,68 @@ public abstract class MicroserviceTemplateBase : TemplateInfo
DeleteUnrelatedProjects(context, steps);
RandomizeStringEncryption(context, steps);
UpdateNuGetConfig(context, steps);
ConfigureTheme(context, steps);
return steps;
}
protected void ConfigureTheme(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{
if (!context.BuildArgs.Theme.HasValue)
{
return;
}
if (context.BuildArgs.Theme == Theme.LeptonX)
{
context.Symbols.Add("LEPTONX");
steps.Add(new ChangeThemeStyleStep());
return;
}
steps.Add(new ChangeThemeStep());
RemoveLeptonXThemePackagesFromPackageJsonFiles(steps);
}
private static void RemoveLeptonXThemePackagesFromPackageJsonFiles(List<ProjectBuildPipelineStep> steps)
{
var packageJsonFilePaths = new List<string>
{
"/MyCompanyName.MyProjectName.AuthServer/package.json",
"/MyCompanyName.MyProjectName.Web/package.json"
};
var blazorServerPackageJsonFilePaths = new List<string>
{
"/MyCompanyName.MyProjectName.Blazor.Server/package.json"
};
var angularPackageJsonFilePaths = new List<string>
{
"/angular/package.json"
};
var mvcUiPackageName = "@volo/abp.aspnetcore.mvc.ui.theme.leptonx";
var blazorServerUiPackageName = "@volo/aspnetcore.components.server.leptonxtheme";
var ngUiPackageName = "@volosoft/abp.ng.theme.lepton-x";
foreach (var packageJsonFilePath in packageJsonFilePaths)
{
steps.Add(new RemoveDependencyFromPackageJsonFileStep(packageJsonFilePath, mvcUiPackageName));
}
foreach (var blazorServerPackageJsonFilePath in blazorServerPackageJsonFilePaths)
{
steps.Add(new RemoveDependencyFromPackageJsonFileStep(blazorServerPackageJsonFilePath, mvcUiPackageName));
steps.Add(new RemoveDependencyFromPackageJsonFileStep(blazorServerPackageJsonFilePath, blazorServerUiPackageName));
}
foreach (var angularPackageJsonFilePath in angularPackageJsonFilePaths)
{
steps.Add(new RemoveDependencyFromPackageJsonFileStep(angularPackageJsonFilePath, ngUiPackageName));
steps.Add(new RemoveDependencyFromPackageJsonFileStep(angularPackageJsonFilePath, "bootstrap-icons"));
}
}
private static void DeleteUnrelatedProjects(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{

6
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/ExceptionMessageHelper.cs

@ -0,0 +1,6 @@
namespace Volo.Abp.Cli.Utils;
public static class ExceptionMessageHelper
{
public static string GetInvalidOptionExceptionMessage(string optionName) => $"The option you provided for {optionName} is invalid!";
}

22
framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/DefaultServiceScopeFactory.cs

@ -1,22 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
namespace Volo.Abp.DependencyInjection;
[ExposeServices(
typeof(IHybridServiceScopeFactory),
typeof(DefaultServiceScopeFactory)
)]
public class DefaultServiceScopeFactory : IHybridServiceScopeFactory, ITransientDependency
{
protected IServiceScopeFactory Factory { get; }
public DefaultServiceScopeFactory(IServiceScopeFactory factory)
{
Factory = factory;
}
public IServiceScope CreateScope()
{
return Factory.CreateScope();
}
}

8
framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/IHybridServiceScopeFactory.cs

@ -1,8 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
namespace Volo.Abp.DependencyInjection;
public interface IHybridServiceScopeFactory : IServiceScopeFactory
{
}

4
framework/src/Volo.Abp.Core/Volo/Abp/ISoftDelete.cs

@ -9,7 +9,7 @@
public interface ISoftDelete
{
/// <summary>
/// Used to mark an Entity as 'Deleted'.
/// Used to mark an Entity as 'Deleted'.
/// </summary>
bool IsDeleted { get; set; }
bool IsDeleted { get; }
}

36
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityChangeEventHelper.cs

@ -42,18 +42,6 @@ public class EntityChangeEventHelper : IEntityChangeEventHelper, ITransientDepen
Logger = NullLogger<EntityChangeEventHelper>.Instance;
}
public virtual void PublishEntityCreatingEvent(object entity)
{
TriggerEventWithEntity(
LocalEventBus,
#pragma warning disable 618
typeof(EntityCreatingEventData<>),
#pragma warning restore 618
entity,
entity
);
}
public virtual void PublishEntityCreatedEvent(object entity)
{
TriggerEventWithEntity(
@ -89,18 +77,6 @@ public class EntityChangeEventHelper : IEntityChangeEventHelper, ITransientDepen
);
}
public virtual void PublishEntityUpdatingEvent(object entity)
{
TriggerEventWithEntity(
LocalEventBus,
#pragma warning disable 618
typeof(EntityUpdatingEventData<>),
#pragma warning restore 618
entity,
entity
);
}
public virtual void PublishEntityUpdatedEvent(object entity)
{
TriggerEventWithEntity(
@ -125,18 +101,6 @@ public class EntityChangeEventHelper : IEntityChangeEventHelper, ITransientDepen
}
}
public virtual void PublishEntityDeletingEvent(object entity)
{
TriggerEventWithEntity(
LocalEventBus,
#pragma warning disable 618
typeof(EntityDeletingEventData<>),
#pragma warning restore 618
entity,
entity
);
}
public virtual void PublishEntityDeletedEvent(object entity)
{
TriggerEventWithEntity(

23
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityChangingEventData.cs

@ -1,23 +0,0 @@
using System;
namespace Volo.Abp.Domain.Entities.Events;
/// <summary>
/// Used to pass data for an event when an entity (<see cref="IEntity"/>) is being changed (creating, updating or deleting).
/// See <see cref="EntityCreatingEventData{TEntity}"/>, <see cref="EntityDeletingEventData{TEntity}"/> and <see cref="EntityUpdatingEventData{TEntity}"/> classes.
/// </summary>
/// <typeparam name="TEntity">Entity type</typeparam>
[Serializable]
[Obsolete("This event is no longer needed and identical to EntityChangedEventData. Please use EntityChangedEventData instead.")]
public class EntityChangingEventData<TEntity> : EntityEventData<TEntity>
{
/// <summary>
/// Constructor.
/// </summary>
/// <param name="entity">Changing entity in this event</param>
public EntityChangingEventData(TEntity entity)
: base(entity)
{
}
}

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

Loading…
Cancel
Save