Browse Source

Merge branch 'dev' into auto-merge/rel-9-0/3279

pull/21575/head
maliming 1 year ago
committed by GitHub
parent
commit
598519c16d
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 7
      Directory.Packages.props
  2. 19
      abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json
  3. 1
      abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json
  4. 14
      abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json
  5. 4
      common.props
  6. 223
      docs/en/Blog-Posts/2024-10-23 v9_0_Preview/POST.md
  7. BIN
      docs/en/Blog-Posts/2024-10-23 v9_0_Preview/abp-team-raffle.jpg
  8. BIN
      docs/en/Blog-Posts/2024-10-23 v9_0_Preview/cover-image.png
  9. BIN
      docs/en/Blog-Posts/2024-10-23 v9_0_Preview/docs-image-larger.png
  10. BIN
      docs/en/Blog-Posts/2024-10-23 v9_0_Preview/dotnet-conf-2024.png
  11. BIN
      docs/en/Blog-Posts/2024-10-23 v9_0_Preview/dotnet-developer-days-2024.jpg
  12. BIN
      docs/en/Blog-Posts/2024-10-23 v9_0_Preview/studio-switch-to-preview.png
  13. BIN
      docs/en/Blog-Posts/2024-10-23 v9_0_Preview/suite-navigation-properties.png
  14. BIN
      docs/en/Blog-Posts/2024-11-19 v9_0_Release_Stable/community-talks.png
  15. BIN
      docs/en/Blog-Posts/2024-11-19 v9_0_Release_Stable/cover-image.png
  16. 93
      docs/en/Blog-Posts/2024-11-19 v9_0_Release_Stable/post.md
  17. BIN
      docs/en/Blog-Posts/2024-11-19 v9_0_Release_Stable/switch-to-stable.png
  18. 4
      docs/en/Community-Articles/2024-06-27-how-to-use-Aspire-with-ABP-framework/How to use Aspire with ABP framework.md
  19. 63
      docs/en/Community-Articles/2024-10-09-Cookies-vs-Local-Storage/Post.md
  20. BIN
      docs/en/Community-Articles/2024-10-09-Cookies-vs-Local-Storage/cover.png
  21. 96
      docs/en/Community-Articles/2024-10-09-NET9-Performance-Improvements/Post.md
  22. BIN
      docs/en/Community-Articles/2024-10-09-NET9-Performance-Improvements/cited-from-microsoft-blog-post.png
  23. BIN
      docs/en/Community-Articles/2024-10-09-NET9-Performance-Improvements/cover.png
  24. 138
      docs/en/Community-Articles/2024-10-11-NET-Aspire-vs-ABP-Studio/POST.md
  25. BIN
      docs/en/Community-Articles/2024-10-11-NET-Aspire-vs-ABP-Studio/abp-overall-diagram.png
  26. BIN
      docs/en/Community-Articles/2024-10-11-NET-Aspire-vs-ABP-Studio/abp-studio-add-existing-package.png
  27. BIN
      docs/en/Community-Articles/2024-10-11-NET-Aspire-vs-ABP-Studio/abp-studio-add-new-microservice.png
  28. BIN
      docs/en/Community-Articles/2024-10-11-NET-Aspire-vs-ABP-Studio/abp-studio-solution-runner.png
  29. BIN
      docs/en/Community-Articles/2024-10-11-NET-Aspire-vs-ABP-Studio/abp-studio-vs-dotnet-aspire-comparison-table.png
  30. BIN
      docs/en/Community-Articles/2024-10-11-NET-Aspire-vs-ABP-Studio/cover.png
  31. BIN
      docs/en/Community-Articles/2024-10-11-NET-Aspire-vs-ABP-Studio/dotnet-aspire-dashboard.png
  32. BIN
      docs/en/Community-Articles/2024-10-23-Abp-Net9-Upgrade/cover.png
  33. BIN
      docs/en/Community-Articles/2024-10-23-Abp-Net9-Upgrade/dog-food.png
  34. BIN
      docs/en/Community-Articles/2024-10-23-Abp-Net9-Upgrade/ef-core-upgrade.png
  35. BIN
      docs/en/Community-Articles/2024-10-23-Abp-Net9-Upgrade/net-support-policy.png
  36. 147
      docs/en/Community-Articles/2024-10-23-Abp-Net9-Upgrade/post.md
  37. 125
      docs/en/Community-Articles/2024-11-01-Hybrid-Cache-Net-9/POST.md
  38. BIN
      docs/en/Community-Articles/2024-11-01-Hybrid-Cache-Net-9/cover-image.png
  39. BIN
      docs/en/Community-Articles/2024-11-01-Hybrid-Cache-Net-9/debug-hybrid-cache.png
  40. 86
      docs/en/Community-Articles/2024-11-04-EF Core 9 Read-only-Primitive-Collections/POST.md
  41. 54
      docs/en/Community-Articles/2024-11-05-.NET Aspire 9.0 Features/Post.md
  42. BIN
      docs/en/Community-Articles/2024-11-05-.NET Aspire 9.0 Features/aspire_resource_lifecycle.jpg
  43. BIN
      docs/en/Community-Articles/2024-11-05-.NET Aspire 9.0 Features/aspire_trace_filter.jpg
  44. 113
      docs/en/Community-Articles/2024-11-05-SignalR-supports-trimming-and-Native-AOT/POST.md
  45. BIN
      docs/en/Community-Articles/2024-11-05-SignalR-supports-trimming-and-Native-AOT/chat.png
  46. 58
      docs/en/Community-Articles/2024-11-06-Keyed-DI-in-Middlewares-Net-9/post.md
  47. 108
      docs/en/Community-Articles/2024-11-06-Optimize-static-web-asset-delivery/POST.md
  48. BIN
      docs/en/Community-Articles/2024-11-13-BuiltIn-OpenApi-Documentation/cover.png
  49. BIN
      docs/en/Community-Articles/2024-11-13-BuiltIn-OpenApi-Documentation/img1.png
  50. BIN
      docs/en/Community-Articles/2024-11-13-BuiltIn-OpenApi-Documentation/img2.png
  51. BIN
      docs/en/Community-Articles/2024-11-13-BuiltIn-OpenApi-Documentation/img3.png
  52. BIN
      docs/en/Community-Articles/2024-11-13-BuiltIn-OpenApi-Documentation/img4.png
  53. BIN
      docs/en/Community-Articles/2024-11-13-BuiltIn-OpenApi-Documentation/img5.png
  54. 164
      docs/en/Community-Articles/2024-11-13-BuiltIn-OpenApi-Documentation/post.md
  55. 202
      docs/en/Community-Articles/2024-11-14-Csharp-13-Features/Post.md
  56. 165
      docs/en/Community-Articles/2024-11-14-EF-Core-9-Linq-SQL-Translation/POST.md
  57. 385
      docs/en/Community-Articles/2024-12-01-OpenAI-Integration/POST.md
  58. BIN
      docs/en/Community-Articles/2024-12-01-OpenAI-Integration/chat-example.gif
  59. BIN
      docs/en/Community-Articles/2024-12-01-OpenAI-Integration/cover-image.png
  60. BIN
      docs/en/Community-Articles/2024-12-01-OpenAI-Integration/image-generation-example.gif
  61. BIN
      docs/en/Community-Articles/2024-12-01-OpenAI-Integration/rag-example-1.gif
  62. BIN
      docs/en/Community-Articles/2024-12-01-OpenAI-Integration/rag-example-2.gif
  63. BIN
      docs/en/Community-Articles/2024-12-01-OpenAI-Integration/sample-page.png
  64. 2
      docs/en/cli/index.md
  65. 6
      docs/en/framework/architecture/domain-driven-design/specifications.md
  66. 2
      docs/en/get-started/index.md
  67. BIN
      docs/en/images/idle-message.png
  68. BIN
      docs/en/images/idle-setting.png
  69. 1
      docs/en/modules/account-pro.md
  70. 19
      docs/en/modules/account/idle-session-timeout.md
  71. 2
      docs/en/modules/openiddict.md
  72. 2
      docs/en/suite/generating-crud-page.md
  73. 296
      framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/DaprAspNetCore/AbpDaprEndpointRouteBuilderExtensions.cs
  74. 135
      framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/AbpAspNetCoreMvcDaprEventBusModule.cs
  75. 6
      framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/AbpAspNetCoreMvcDaprPubSubConsts.cs
  76. 62
      framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/Controllers/AbpAspNetCoreMvcDaprEventsController.cs
  77. 3
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/ConventionalRouteBuilder.cs
  78. 3
      framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor
  79. 3
      framework/src/Volo.Abp.Core/Volo.Abp.Core.csproj
  80. 26
      framework/src/Volo.Abp.Core/Volo/Abp/Threading/SemaphoreSlimExtensions.cs
  81. 9
      framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/LocalAbpDistributedLock.cs
  82. 11
      framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/AbpHttpClientOptions.cs
  83. 5
      framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/ClientProxying/ClientProxyBase.cs
  84. 2
      framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/es.json
  85. 16
      framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/AbpHttpClientTestModule.cs
  86. 3
      framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/IRegularTestController.cs
  87. 8
      framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestController.cs
  88. 8
      framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestControllerClientProxy_Tests.cs
  89. 2
      modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogDto.cs
  90. 5
      modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/IBlogAdminAppService.cs
  91. 44
      modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogAdminAppService.cs
  92. 9
      modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogPostAdminAppService.cs
  93. 2
      modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/CmsKitAdminApplicationAutoMapperProfile.cs
  94. 8
      modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Pages/PageAdminAppService.cs
  95. 14
      modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi.Client/ClientProxies/Volo/CmsKit/Admin/Blogs/BlogAdminClientProxy.Generated.cs
  96. 117
      modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi.Client/ClientProxies/cms-kit-admin-generate-proxy.json
  97. 15
      modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogAdminController.cs
  98. 59
      modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Blogs/DeleteBlogModal.cshtml
  99. 57
      modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Blogs/DeleteBlogModal.cshtml.cs
  100. 46
      modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Blogs/index.js

7
Directory.Packages.props

@ -6,7 +6,7 @@
<PackageVersion Include="AlibabaCloud.SDK.Dysmsapi20170525" Version="3.0.0" />
<PackageVersion Include="aliyun-net-sdk-sts" Version="3.1.2" />
<PackageVersion Include="Aliyun.OSS.SDK.NetCore" Version="2.14.1" />
<PackageVersion Include="AsyncKeyedLock" Version="7.0.1" />
<PackageVersion Include="AsyncKeyedLock" Version="7.1.3" />
<PackageVersion Include="Autofac" Version="8.1.0" />
<PackageVersion Include="Autofac.Extensions.DependencyInjection" Version="10.0.0" />
<PackageVersion Include="Autofac.Extras.DynamicProxy" Version="7.1.0" />
@ -39,8 +39,8 @@
<PackageVersion Include="EphemeralMongo6.runtime.win-x64" Version="1.1.3" />
<PackageVersion Include="FluentValidation" Version="11.10.0" />
<PackageVersion Include="Google.Cloud.Storage.V1" Version="4.10.0" />
<PackageVersion Include="Hangfire.AspNetCore" Version="1.8.14" />
<PackageVersion Include="Hangfire.SqlServer" Version="1.8.14" />
<PackageVersion Include="Hangfire.AspNetCore" Version="1.8.17" />
<PackageVersion Include="Hangfire.SqlServer" Version="1.8.17" />
<PackageVersion Include="HtmlSanitizer" Version="8.1.870" />
<PackageVersion Include="IdentityModel" Version="7.0.0" />
<PackageVersion Include="IdentityServer4" Version="4.1.2" />
@ -166,6 +166,7 @@
<PackageVersion Include="System.Text.Encoding.CodePages" Version="9.0.0.0" />
<PackageVersion Include="System.Text.Encodings.Web" Version="9.0.0.0" />
<PackageVersion Include="System.Text.Json" Version="9.0.0.0" />
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="8.1.0" />
<PackageVersion Include="TimeZoneConverter" Version="6.1.0" />
<PackageVersion Include="Unidecode.NET" Version="2.1.0" />

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

@ -22,6 +22,7 @@
"Permission:Accounting": "Accounting",
"Permission:Accounting:Quotation": "Quotation",
"Permission:Accounting:Invoice": "Invoice",
"Permission:Export" : "Export",
"Menu:Organizations": "Organizations",
"Menu:Accounting": "Accounting",
"Menu:Packages": "Packages",
@ -511,6 +512,7 @@
"QuotationTemplate.BankAccount": "Our bank account information can be found at {0}",
"Permission:Raffles": "Raffle",
"Permission:Draw": "Draw",
"Permission:ExportAttendeesAsExcel": "Export at attendees as Excel",
"Menu:Raffles": "Raffles",
"RaffleIsNotDrawable": "Raffle is not drawable",
"WinnerCountMustBeGreaterThanZero": "Winner count must be greater than zero",
@ -649,6 +651,19 @@
"Permission:HeroSections": "Hero Sections",
"RedirectLink": "Redirect link",
"HeroSectionsDeletionConfirmationMessage": "Are you sure you want to delete the hero section?",
"AbpStudioName": "Abp Studio name"
"AbpStudioName": "ABP Studio name",
"Permission:EditAttendees": "Edit Attendees",
"AttendeesCount": "Attendees Count",
"CreateQRCode": "Create QR Code",
"DrawTV": "Public draw on the TV",
"DrawModal": "Private draw on the modal",
"SetAsDrawable": "Set as drawable",
"SetAsNoDrawable": "Set as non-drawable",
"SetAsCompleted": "Set as completed",
"RemoveAllWinners": "Remove all winners",
"EditWinners": "Edit winners",
"EditAttendees": "Edit attendees",
"ExportAttendeesAsExcel": "Export attendees as Excel",
"DuplicateRaffle": "Duplicate raffle"
}
}
}

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

@ -1211,6 +1211,5 @@
"TrainingDescription": "We are offering the following training packages for who want to get expertise on the ABP Framework and the ABP.",
"PurchaseDevelopers": "developers",
"LinkExpiredMessage": "The payment link has expired! Contact us at <a href='mailto:sales@volosoft.com'>sales@volosoft.com</a> to update the link or <a href='https://abp.io/contact'>click here</a> to navigate to the contact page."
}
}

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

@ -446,6 +446,7 @@
"PackageDetailPage_InstallingUsingPMCDescription1": "Open the <strong>Package Manager Console</strong> in Visual Studio (Tools -> Nuget Package Manager -> Package Manager Console) and execute the following command",
"UIOptions": "UI Options",
"Testimonials": "Testimonials",
"TestimonialsDescription": "Our clients' feedback is invaluable to us. Discover what they have to say about their experience working with us.",
"CoolestCompaniesUseABPFramework": "Coolest Companies Use <span class=\"fw-bold\">ABP Framework</span>",
"Index_Page_Testimonial_1": "ABP Framework is not just a tool but a catalyst that has accelerated my growth as a developer. It has made it possible for me to build new features faster than ever before, reminiscent of the experiences of other users. The unified coding pattern has streamlined my projects, giving me more time to focus on creating rather than troubleshooting.\nI would say the ABP Framework has been the cornerstone of my early professional journey. It has facilitated my transition from an aspiring developer to a confident professional ready to make a mark in the software world. I am looking forward to the exciting projects that await me, knowing that ABP will be there to guide me. It is more than just a product; it's a partner in success.",
"Index_Page_Testimonial_2": "ABP Framework is not only a framework, it is also a guidance for project development/management, because it provides DDD, GenericRepository, DI, Microservice, Modularity trainings. Even if you are not going to use framework itself, you can develop yourself with abp.io/docs which is well and professionally prepared. (OpenIddict, Redis, Quartz etc.)\nBecause many thing pre-built, it shortens project development time significantly. (Such as login page, exception handling, data filtering-seeding, audit logging, localization, auto api controller etc.)\nAs an example from our app, i have used Local Event Bus for stock control. So, I am able to manage order movements by writing stock handler.\nIt is wonderful not to lose time for CreationTime, CreatorId. They are filled automatically.",
@ -458,7 +459,7 @@
"FullName": "Full name",
"CompanySize": "Company size",
"TestimonialTitle": "Let's hear your testimonial",
"TestimonialInfo": "What our customers say matters! Tell us about your experience with our product and service. It is recommended to write the testimonial in English to reach a wider audience.",
"TestimonialInfo": "What you say matters! Tell us about your experience with ABP in a few sentences. Please write it in English to reach a wider audience.",
"Country": "Country",
"TestimonialTextPlaceholder": "Write a brief story about how ABP helped you build and deliver your project.",
"PositionPlaceholder": "Your position at your company",
@ -549,7 +550,7 @@
"CommercialLicenses": "Commercial Licenses",
"WhatIsDifferencePaidLicenses": "What is the difference between a personal license and other types of paid licenses?",
"DifferencePaidLicenseExplanation1": "A non-personal paid license is the standard licensing option for enterprises and commercial entities. Licenses are purchased by the company and can be used by anyone within the organization.",
"DifferencePaidLicenseExplanation2": "Personal License; on the other hand, is a type of license for private individuals/freelancers/independent developers who purchase licenses with their own funds and solely for their own use. The Personal License has some limitations. In this plan, there can only be 1 developer working on the ABP project and no additional developers are allowed to be added later to the project. Downloading the source-code of PRO modules is not allowed in the personal license plan. Also, there is no microservice template and tier (layered) architecture in this plan. Personal License holders can only use the following modules: <a href=\"/modules/Volo.Account.Pro\">Account</a>, <a href=\"/modules/Volo.AuditLogging.Ui\">Audit Logging UI</a>, <a href=\"/modules/Volo.Gdpr\">GDPR</a>, <a href=\"/modules/Volo.Identity.Pro\">Identity</a>, <a href=\"/modules/Volo.LanguageManagement\">Language Management</a>, <a href=\"/modules/Volo.Abp.LeptonXTheme.Pro\">LeptonX PRO</a>, <a href=\"/modules/Volo.OpenIddict.Pro\">OpenIddict UI</a> and <a href=\"/modules/Volo.Saas\">SaaS</a>. Personal License holders cannot use the following modules: <a href=\"/modules/Volo.Chat\">Chat</a>, <a href=\"/modules/Volo.CmsKit.Pro\">CMS-Kit PRO</a>, <a href=\"/modules/Volo.FileManagement\">File Management</a>, <a href=\"/modules/Volo.Forms\">Forms</a>, <a href=\"/modules/Volo.Payment\">Payment</a>, <a href=\"/modules/Volo.TextTemplateManagement\">Text Template Management</a>, and <a href=\"/modules/Volo.Abp.Sms.Twilio\">Twilio SMS</a>. You can access the full module list at <a href=\"/modules\">abp.io/modules</a>.",
"DifferencePaidLicenseExplanation2": "Personal License; on the other hand, is a type of license for private individuals/freelancers/independent developers who purchase licenses with their own funds and solely for their own use. The Personal License has some limitations. In this plan, there can only be 1 developer working on the ABP project and no additional developers are allowed to be added later to the project. Downloading the source-code of PRO modules is not allowed in the personal license plan. There is no microservice template in this plan. There is no tier architecture (Web and HTTP API layers are physically separated) in this plan. Personal License holders can only use the following modules: <a href=\"/modules/Volo.Account.Pro\">Account</a>, <a href=\"/modules/Volo.AuditLogging.Ui\">Audit Logging UI</a>, <a href=\"/modules/Volo.Gdpr\">GDPR</a>, <a href=\"/modules/Volo.Identity.Pro\">Identity</a>, <a href=\"/modules/Volo.LanguageManagement\">Language Management</a>, <a href=\"/modules/Volo.Abp.LeptonXTheme.Pro\">LeptonX PRO</a>, <a href=\"/modules/Volo.OpenIddict.Pro\">OpenIddict UI</a> and <a href=\"/modules/Volo.Saas\">SaaS</a>. Personal License holders cannot use the following modules: <a href=\"/modules/Volo.Chat\">Chat</a>, <a href=\"/modules/Volo.CmsKit.Pro\">CMS-Kit PRO</a>, <a href=\"/modules/Volo.FileManagement\">File Management</a>, <a href=\"/modules/Volo.Forms\">Forms</a>, <a href=\"/modules/Volo.Payment\">Payment</a>, <a href=\"/modules/Volo.TextTemplateManagement\">Text Template Management</a>, and <a href=\"/modules/Volo.Abp.Sms.Twilio\">Twilio SMS</a>. You can access the full module list at <a href=\"/modules\">abp.io/modules</a>.",
"ReadyToStart": "Ready to start?",
"TransformYourIdeasIntoRealityWithOurProfessionalNETDevelopmentServices": "Transform your ideas into reality with our professional .NET development services.",
"ReadyToUpgrade": "Ready to upgrade?",
@ -1690,8 +1691,8 @@
"HurryUpLastDay": "Hurry Up! Last Day: {0}",
"CreatingCRUDPagesWithABPSuite": "Creating CRUD pages with ABP Suite",
"MultipleYearDiscount": "Multiple Year Discount",
"CampaignDiscountText": "New Platform Discount",
"CampaignDiscountName": "New Platform",
"CampaignDiscountText": "Black Friday Discount",
"CampaignDiscountName": "Black Friday",
"CampaignName:BlackFriday": "Black Friday",
"MultipleOrganizationInfo": "See All Your Organizations",
"AbpStudioBetaAccessInfoTitle": "ABP Studio Beta Access",
@ -1866,6 +1867,7 @@
"NewsletterEmailFooterTemplateDeleteSubscription": "<a style=\"color: #007bff;\" href=\"{0}\" data-root=\"{1}\">If you change your mind, you're always welcome to resubscribe!</a>",
"GenerateQuote" : "Generate Quote" ,
"GeneratePriceQuote": "Generate a Price Quote",
"Qa:QuestionPageTitle": "Support"
"Qa:QuestionPageTitle": "Support",
"SelectedTrainingName" : "Trainings"
}
}
}

4
common.props

@ -1,8 +1,8 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>9.0.1</Version>
<LeptonXVersion>4.0.1</LeptonXVersion>
<Version>9.1.0-preview</Version>
<LeptonXVersion>4.1.0-preview</LeptonXVersion>
<NoWarn>$(NoWarn);CS1591;CS0436</NoWarn>
<PackageIconUrl>https://abp.io/assets/abp_nupkg.png</PackageIconUrl>
<PackageProjectUrl>https://abp.io/</PackageProjectUrl>

223
docs/en/Blog-Posts/2024-10-23 v9_0_Preview/POST.md

@ -0,0 +1,223 @@
# ABP Platform 9.0 Has Been Released Based on .NET 9.0
![](cover-image.png)
Today, we are happy to release the [ABP](https://abp.io/) version **9.0 RC** (Release Candidate). This blog post introduces the new features and important changes in this new version.
Try this version and provide feedback for a more stable version of ABP v9.0! Thanks to all of you.
## Get Started with the 9.0 RC
You can check the [Get Started page](https://abp.io/get-started) to see how to get started with ABP. You can either download [ABP Studio](https://abp.io/get-started#abp-studio-tab) (**recommended**, if you prefer a user-friendly GUI application - desktop application) or use the [ABP CLI](https://abp.io/docs/latest/cli).
By default, ABP Studio uses stable versions to create solutions. Therefore, if you want to create a solution with a preview version, first you need to create a solution and then switch your solution to the preview version from the ABP Studio UI:
![](studio-switch-to-preview.png)
## Migration Guide
There are a few breaking changes in this version that may affect your application. Please read the migration guide carefully, if you are upgrading from v8.x: [ABP Version 9.0 Migration Guide](https://abp.io/docs/9.0/release-info/migration-guides/abp-9-0)
## What's New with ABP v9.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:
* Upgraded to .NET 9.0
* Introducing the **Extension Property Policy**
* Allow wildcards for Redirect Allowed URLs
* Docs Module: Show larger images on the same page
* Google Cloud Storage BLOB Provider
* Removed React Native mobile option from free templates
* Suite: Better naming for multiple navigation properties to the same entity
* CMS Kit Pro: Feedback feature improvements
### Upgraded to .NET 9.0
We've upgraded ABP to .NET 9.0, so you need to move your solutions to .NET 9.0 if you want to use ABP 9.0. You can check [Microsoft’s Migrate from ASP.NET Core 8.0 to 9.0 documentation](https://learn.microsoft.com/en-us/aspnet/core/migration/80-90), to see how to update an existing ASP.NET Core 8.0 project to ASP.NET Core 9.0.
> **Note:** Since the stable version of .NET 9 hasn't been released yet, we upgraded ABP to .NET v9.0-rc.2. We will update the entire ABP Platform to .NET 9 stable, after Microsoft releases it on November 13-14 with the stable ABP 9.0 release.
### Introducing the Extension Property Policy
ABP provides a module entity extension system, which is a high level extension system that allows you to define new properties for existing entities of the depended modules. This is a powerful way to dynamically add additional properties to entities without modifying the core structure. However, managing these properties across different modules and layers can become complex, especially when different policies or validation rules are required.
**Extension Property Policy** feature allows developers to define custom policies for these properties, such as access control, validation, and data transformation, directly within ABP.
**Example:**
```csharp
ObjectExtensionManager.Instance.Modules().ConfigureIdentity(identity =>
{
identity.ConfigureUser(user =>
{
user.AddOrUpdateProperty<string>( //property type: string
"SocialSecurityNumber", //property name
property =>
{
//validation rules
property.Attributes.Add(new RequiredAttribute());
property.Attributes.Add(new StringLengthAttribute(64) {MinimumLength = 4});
//Global Features
property.Policy.GlobalFeatures = new ExtensionPropertyGlobalFeaturePolicyConfiguration()
{
Features = new[] {"GlobalFeatureName1", "GlobalFeatureName2"},
RequiresAll = true
};
//Features
property.Policy.Features = new ExtensionPropertyFeaturePolicyConfiguration()
{
Features = new[] {"FeatureName1", "FeatureName2"},
RequiresAll = false
};
//Permissions
property.Policy.Permissions = new ExtensionPropertyPermissionPolicyConfiguration()
{
PermissionNames = new[] {"AbpTenantManagement.Tenants.Update", "AbpTenantManagement.Tenants.Delete"},
RequiresAll = true
};
}
);
});
});
```
### Allow Wildcards for RedirectAllowedURLs
In this version, we made an improvement to the `RedirectAllowedUrls` configuration, which now allows greater flexibility in defining redirect URLs. Previously, developers faced restrictions when configuring URL redirects. Specifically, the `RedirectAllowedUrls` did not support using **wildcards (*)**, limiting how developers could specify which URLs were permissible for redirects.
With the new changes in [#20628](https://github.com/abpframework/abp/pull/20628), the restriction has been relaxed, allowing developers to define redirect URLs that include wildcards. This makes it easier to handle scenarios where a broad range of URLs need to be allowed, without explicitly listing each one.
```json
{
"App": {
//...
"RedirectAllowedUrls": "http://*.domain,http://*.domain:4567"
}
```
### Docs Module: Show Larger Images
As developers, we rely heavily on clear documentation to understand complex concepts and workflows. Often, an image is worth more than a thousand words, especially when explaining intricate user interfaces, workflows, or code structures. In recognition of this, we recently rolled out an improvement to the Docs Module that enables larger images to be displayed more effectively.
![](docs-image-larger.png)
Before this enhancement, images embedded in documentation were often limited in size, which sometimes made it difficult to see the details in the diagrams, screenshots, or other visual contents. Now, images can be displayed at a larger size, offering better clarity and usability.
> See [https://github.com/abpframework/abp/pull/20557](https://github.com/abpframework/abp/pull/20557) for more information.
### Google Cloud Storage BLOB Provider
ABP provides a BLOB Storing System, which allows you to work with BLOBs. This system is typically used to store file contents in a project and read these file contents when they are needed. Since ABP provides an abstraction to work with BLOBs, it also provides some pre-built storage providers such as [Azure](https://abp.io/docs/latest/framework/infrastructure/blob-storing/azure), [Aws](https://abp.io/docs/latest/framework/infrastructure/blob-storing/aws) and [Aliyun](https://abp.io/docs/latest/framework/infrastructure/blob-storing/aliyun).
In this version, we have introduced a new BLOB Storage Provider for Google Cloud Storage: [`Volo.Abp.BlobStoring.Google`](https://www.nuget.org/packages/Volo.Abp.BlobStoring.Google)
You can [read the documentation](https://abp.io/docs/9.0/framework/infrastructure/blob-storing/google) for configurations and use Google Cloud Storage as your BLOB Storage Provider easily.
### Removed React Native Mobile Option From Free Templates
In this version, we removed the **React Native** mobile option from the open source templates due to maintaining reasons. We updated the related documents and the ABP CLI (both old & new CLI) for this change, and with v9.0, you will not be able to create a free template with react-native as the mobile option.
> **Note:** Pro templates still provide the **React Native** as the mobile option and we will continue supporting it.
If you want to access the open-source React-Native template, you can visit the abp-archive repository from [here](https://github.com/abpframework/abp-archive).
### Suite: Better Naming For Multiple Navigation Properties
Prior to this version, when you defined multiple (same) navigation properties to same entity, then ABP Suite was renaming them with a duplicate number.
As an example,let's assume that you have a book with an author and coauthor, prior to this version ABP Suite was creating a DTO class as below:
```csharp
public class BookWithNavigationPropertiesDto
{
public BookDto Book { get; set; }
public AuthorDto Author { get; set; }
public AuthorDto Author1 { get; set; }
}
```
Notice, that since the book entity has two same navigation properties, ABP Suite renamed them with a duplicate number. In this version, ABP Suite will ask you to define a propertyName for the **navigation properties** and you'll be able to specify a meaningful name such as (*CoAuthor*, in this example):
```csharp
public class BookWithNavigationPropertiesDto
{
public BookDto Book { get; set; }
public AuthorDto Author { get; set; }
//used the specified property name
public AuthorDto CoAuthor { get; set; }
}
```
ABP Suite respects the specified property name for the related navigation property and generates codes regarding that (by removing the *Id* postfix for the related places):
![](suite-navigation-properties.png)
### CMS Kit Pro: Feedback Feature Improvements
In this version, we revised the [CMS Kit's Feedback Feature](https://abp.io/docs/9.0/modules/cms-kit-pro/page-feedback) and as a result, we made the following improvements:
* A new **auto-handle** setting has been added to the settings page. When this feature is enabled, if feedback is submitted without a user note, the feedback is automatically marked as handled.
* You can now require users to enter a note when submitting negative feedback. This can be configured in the settings page, ensuring that users provide context when they submit critical feedback.
* We've added a feedback user ID that is saved in local storage. This allows you to track the number of unique users submitting feedback or determine if the same user is sending new feedback on updated documents.
> For further information about the Page Feedback System, please refer to the [documentation](https://abp.io/docs/9.0/modules/cms-kit-pro/page-feedback).
## Community News
### Join ABP at the .NET Conf 2024!
ABP is excited to sponsor the [14th annual .NET Conf](https://www.dotnetconf.net/)! We've proudly supported the .NET community for years and recognize the importance of this premier virtual event. Mark your calendars for November 12-14, 2024, and join us for 3 incredible days of learning, networking, and fun.
![](dotnet-conf-2024.png)
Also, don't miss out on the co-founder of [Volosoft](https://volosoft.com/) and Lead Developer of [ABP](https://abp.io/), [Halil Ibrahim Kalkan](https://x.com/hibrahimkalkan)'s talk about "Building Modular Monolith Applications with ASP.NET Core and ABP Studio" at 10:00 - 10:30 AM GMT+3 on Thursday, November 14.
### ABP Team Attended the .NETDeveloperDays 2024
We are thrilled to announce that we sponsored the [.NETDevelopersDays 2024](https://developerdays.eu/warsaw/) event. It's one of the premier conferences for .NET developers with **over 1.000 attendees**, **50+ expert speakers**, and **40+ sessions and workshops**.
![](dotnet-developer-days-2024.jpg)
Core team members of the ABP Framework, [Halil Ibrahim Kalkan](https://twitter.com/hibrahimkalkan), [İsmail Çağdaş](https://x.com/ismcagdas), [Enis Necipoğlu](https://x.com/EnisNecipoglu), and [Tarık Özdemir](https://x.com/mtozdemir) attended [.NETDevelopersDays 2024](https://developerdays.eu/warsaw/) on October 22-23, 2024 at Warsaw, Poland.
These 2 days with the team were all about chatting and having fun with amazing attendees and speakers. We met with talented and passionate software developers and introduced the [ABP](https://github.com/abpframework/abp) - web application framework built on ASP.NET Core - to them.
Also, we made a raffle and gifted an Xbox Series S to the lucky winner at the event:
![](abp-team-raffle.jpg)
Thanks to everyone who joined the fun and visited at our booth :)
### New ABP Community Articles
There are exciting articles contributed by the ABP community as always. I will highlight some of them here:
* [Alper Ebiçoğlu](https://twitter.com/alperebicoglu) has created **five** new community articles:
* [When to Use Cookies, When to Use Local Storage?](https://abp.io/community/articles/when-to-use-cookies-when-to-use-local-storage-uexsjunf)
* [.NET 9 Performance Improvements Summary](https://abp.io/community/articles/.net-9-performance-improvements-summary-gmww3gl8)
* [ASP.NET Core SignalR New Features — Summary](https://abp.io/community/articles/asp.net-core-signalr-new-features-summary-kcydtdgq)
* [Difference Between "Promise" and "Observable" in Angular](https://abp.io/community/articles/difference-between-promise-and-observable-in-angular-bxv97pkc)
* [ASP.NET Core Blazor 9.0 New Features Summary 🆕](https://abp.io/community/articles/asp.net-core-blazor-9.0-new-features-summary--x0fovych)
* [Mohammad AlMohammad AlMahmoud](https://abp.io/community/members/Mohammad97Dev) has created **two** new community articles:
* [Implementing Multi-Language Functionality With ABP Framework](https://abp.io/community/articles/implementing-multilanguage-functionality-with-abp-framework-loq7kfx4)
* [Configure Quartz.Net in Abp FrameWork](https://abp.io/community/articles/configure-quartz.net-in-abp-framework-3bveq4y1)
* [.NET Aspire vs ABP Studio: Side by Side](https://abp.io/community/articles/.net-aspire-vs-abp-studio-side-by-side-t1c73d1l) by [Halil İbrahim Kalkan](https://twitter.com/hibrahimkalkan)
* [PoC of using GrapesJS for ABPs CMS Kit](https://abp.io/community/articles/poc-of-using-grapesjs-for-abps-cms-kit-1rmv4q41) by [Jack Fistelmann](https://abp.io/community/members/jfistelmann)
* [ABP-Powered Web App with Inertia.js, React, and Vite](https://abp.io/community/articles/abppowered-web-app-with-inertia.js-react-and-vite-j7cccvad) by [Anto Subash](https://antosubash.com/)
* [Multi-Tenancy Support in Angular Apps with ABP.IO](https://abp.io/community/articles/multitenancy-support-in-angular-apps-with-abp.io-lw9l36c5) by [HeadChannel Team](https://headchannel.co.uk/)
Thanks to the ABP Community for all the content they have published. You can also [post your ABP-related (text or video) content](https://abp.io/community/posts/submit) to the ABP Community.
## Conclusion
This version comes with some new features and a lot of enhancements to the existing features. You can see the [Road Map](https://abp.io/docs/9.0/release-info/road-map) documentation to learn about the release schedule and planned features for the next releases. Please try ABP v9.0 RC and provide feedback to help us release a more stable version.
Thanks for being a part of this community!

BIN
docs/en/Blog-Posts/2024-10-23 v9_0_Preview/abp-team-raffle.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 KiB

BIN
docs/en/Blog-Posts/2024-10-23 v9_0_Preview/cover-image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 KiB

BIN
docs/en/Blog-Posts/2024-10-23 v9_0_Preview/docs-image-larger.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

BIN
docs/en/Blog-Posts/2024-10-23 v9_0_Preview/dotnet-conf-2024.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 892 KiB

BIN
docs/en/Blog-Posts/2024-10-23 v9_0_Preview/dotnet-developer-days-2024.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

BIN
docs/en/Blog-Posts/2024-10-23 v9_0_Preview/studio-switch-to-preview.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
docs/en/Blog-Posts/2024-10-23 v9_0_Preview/suite-navigation-properties.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
docs/en/Blog-Posts/2024-11-19 v9_0_Release_Stable/community-talks.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

BIN
docs/en/Blog-Posts/2024-11-19 v9_0_Release_Stable/cover-image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 KiB

93
docs/en/Blog-Posts/2024-11-19 v9_0_Release_Stable/post.md

@ -0,0 +1,93 @@
# ABP.IO Platform 9.0 Has Been Released Based on .NET 9.0
![](cover-image.png)
Today, [ABP](https://abp.io/) 9.0 stable version has been released based on [.NET 9.0](https://dotnet.microsoft.com/en-us/download/dotnet/9.0). You can create solutions with ABP 9.0 starting from ABP Studio v0.9.11 or by using the ABP CLI as explained in the following sections.
## What's New With Version 9.0?
All the new features were explained in detail in the [9.0 RC Announcement Post](https://abp.io/blog/announcing-abp-9-0-release-candidate), so there is no need to review them again. You can check it out for more details.
## Getting Started with 9.0
### Creating New Solutions
You can check the [Get Started page](https://abp.io/get-started) to see how to get started with ABP. You can either download [ABP Studio](https://abp.io/get-started#abp-studio-tab) (**recommended**, if you prefer a user-friendly GUI application - desktop application) or use the [ABP CLI](https://abp.io/docs/latest/cli) to create new solutions.
By default, ABP Studio uses stable versions to create solutions. Therefore, it will be creating the solution with the latest stable version, which is v9.0 for now, so you don't need to specify the version. **You can create solutions with ABP 9.0 starting from v0.9.11.**
### How to Upgrade an Existing Solution
You can upgrade your existing solutions with either ABP Studio or ABP CLI. In the following sections, both approaches are explained:
### Upgrading via ABP Studio
If you are already using the ABP Studio, you can upgrade it to the latest version to align it with ABP v9.0. ABP Studio periodically checks for updates in the background, and when a new version of ABP Studio is available, you will be notified through a modal. Then, you can update it by confirming the opened modal. See [the documentation](https://abp.io/docs/latest/studio/installation#upgrading) for more info.
After upgrading the ABP Studio, then you can open your solution in the application, and simply click the **Switch to stable** action button to instantly upgrade your solution:
![](switch-to-stable.png)
> Please note that ABP CLI & ABP Studio only upgrade the related ABP packages, so you need to upgrade the other packages for .NET 9.0 manually.
### Upgrading via ABP CLI
Alternatively, you can upgrade your existing solution via ABP CLI. First, you need to install the ABP CLI or upgrade it to the latest version.
If you haven't installed it yet, you can run the following command:
```bash
dotnet tool install -g Volo.Abp.Studio.Cli
```
Or to update the existing CLI, you can run the following command:
```bash
dotnet tool update -g Volo.Abp.Studio.Cli
```
After installing/updating the ABP CLI, you can use the [`update` command](https://abp.io/docs/latest/CLI#update) to update all the ABP related NuGet and NPM packages in your solution as follows:
```bash
abp update
```
You can run this command in the root folder of your solution to update all ABP related packages.
> Please note that ABP CLI & ABP Studio only upgrade the related ABP packages, so you need to upgrade the other packages for .NET 9.0 manually.
## Migration Guides
There are a few breaking changes in this version that may affect your application. Please read the migration guide carefully, if you are upgrading from v8.x: [ABP Version 9.0 Migration Guide](https://abp.io/docs/9.0/release-info/migration-guides/abp-9-0)
## Community News
### Highlights from .NET 9.0
Our team has closely followed the ASP.NET Core and Entity Framework Core 9.0 releases, read Microsoft's guides and documentation, and adapted the changes to our ABP.IO Platform. We are proud to say that we've shipped the ABP 9.0 based on .NET 9.0 just after Microsoft's .NET 9.0 release.
In addition to the ABP's .NET 9.0 upgrade, our team has created many great articles to highlight the important features coming with ASP.NET Core 9.0 and Entity Framework Core 9.0.
> You can read [this post](https://volosoft.com/blog/Highlights-for-ASP-NET-Entity-Framework-Core-NET-9-0) to see the list of all articles.
### New ABP Community Articles
In addition to [the articles to highlight .NET 9.0 features written by our team](https://volosoft.com/blog/Highlights-for-ASP-NET-Entity-Framework-Core-NET-9-0), here are some of the recent posts added to the [ABP Community](https://abp.io/community):
* [Video: Building Modular Monolith Applications with ASP.NET Core & ABP Studio](https://abp.io/community/videos/building-modular-monolith-applications-with-asp.net-core-abp-studio-66znukvf) by [Halil İbrahim Kalkan](https://x.com/hibrahimkalkan)
* [How to create your Own AI Bot on WhatsApp Using an ABP.io Template](https://abp.io/community/articles/how-to-create-your-own-ai-bot-on-whatsapp-using-the-abp-framework-c6jgvt9c) by [Michael Kokula](https://abp.io/community/members/Michal_Kokula)
* [ABP Now Supports .NET 9](https://abp.io/community/articles/abp-now-supports-.net-9-zpkznc4f) by [Alper Ebiçoğlu](https://x.com/alperebicoglu)
Thanks to the ABP Community for all the content they have published. You can also [post your ABP related (text or video) content](https://abp.io/community/posts/submit) to the ABP Community.
### ABP Community Talks 2024.7: What’s New with .NET 9 & ABP 9?
![](community-talks.png)
In this episode of ABP Community Talks, 2024.7; we will dive into the features that came with .NET 9.0 with [Alper Ebicoglu](https://github.com/ebicoglu), [Engincan Veske](https://github.com/EngincanV), [Berkan Sasmaz](https://github.com/berkansasmaz) and [Ahmet Faruk Ulu](https://github.com/ahmetfarukulu).
## Conclusion
This version comes with some new features and a lot of enhancements to the existing features. You can see the [Road Map](https://docs.abp.io/en/abp/9.0/Road-Map) documentation to learn about the release schedule and planned features for the next releases. Please try ABP v9.0 and provide feedback to help us release more stable versions.
Thanks for being a part of this community!

BIN
docs/en/Blog-Posts/2024-11-19 v9_0_Release_Stable/switch-to-stable.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

4
docs/en/Community-Articles/2024-06-27-how-to-use-Aspire-with-ABP-framework/How to use Aspire with ABP framework.md

@ -300,3 +300,7 @@ After making all our changes, we can run the `AspirationalAbp.AppHost` project.
## Conclusion
Combining .NET Aspire with the ABP framework creates a powerful setup for building robust, observable, and feature-rich applications. By integrating Aspire's observability and cloud capabilities with ABP's approach of focusing on your business without repeating yourself, you can develop feature-rich, scalable applications with enhanced monitoring and seamless cloud integration. This guide provides a clear path to set up and configure these technologies, ensuring your applications are well-structured, maintainable, and ready for modern cloud environments.
## See Also
* [.NET Aspire vs ABP Studio: Side by Side](https://abp.io/community/articles/.net-aspire-vs-abp-studio-side-by-side-t1c73d1l)

63
docs/en/Community-Articles/2024-10-09-Cookies-vs-Local-Storage/Post.md

@ -0,0 +1,63 @@
# When to Use Cookies, When to Use Local Storage?
![cover](cover.png)
## Cookies vs Local Storage
When you want to save client-side data on browsers, you can use `Cookies` or `Local Storage` of the browser. While these methods look similar, they have different behaviors. You need to decide based on the specific use-case, security concerns and the data size being stored. I'll clarify the differences between these methods.
## When to use Cookies 🍪?
1. **Server Communication (e.g: Authentication Tokens):** Cookies are ideal when you need to send data automatically with HTTP requests to the server, such as authentication tokens (JWTs) or session IDs. Cookies can be configured to be sent only to specific domains or paths, making them useful for session management.
2. **Cross-Domain Communication:** Cookies can be shared across subdomains, which is useful when working with multiple subdomains under the same parent domain for microservice architecture.
3. **Expiration Control:** Cookies come with built-in expiration times. You don’t need to manually remove them after a certain period that should expire.
4. **Security:** Cookies can be marked as `HttpOnly` which makes them accessible **only via the server**, not via JavaScript! Also, when you set a cookie attribute, `Secure` it can be sent only over HTTPS, which forces enhanced security for sensitive data.
### Considerations for Cookies
- **Size Limitation:** Cookies are generally limited to around 4KB of data.
- **Security Risks:** Cookies are susceptible to cross-site scripting (XSS) attacks unless marked `HttpOnly`.
---
## When to use Local Storage🗄️?
1. **Client-Side Data Storage:** Local storage is ideal for storing large amounts of data (up to 5–10 MB) that doesn’t need to be sent to the server with every request. For example; *user preferences*, *settings*, or *cached data*.
2. **Persistence:** Data in local storage persists even after the browser is restarted. This behavior makes it useful for long-term storage needs.
3. **No Automatic Server Transmission:** Local storage data is never automatically sent to the server, which can be a security advantage if you don’t want certain data to be exposed to the server or included in the requests.
### Considerations for Local Storage
- **Security Risks:** Local storage is accessible via JavaScript, making it vulnerable to XSS attacks. Sensitive data should not be stored in local storage unless adequately encrypted.
- **No Expiration Mechanism:** Local storage does not have a built-in expiration mechanism. You must manually remove the data when it’s no longer needed.
---
## Summary
### Use Cookies
- For data that needs to be sent to the server with HTTP requests, particularly for session management or authentication purposes.
### Use Local Storage
- For storing large amounts of client-side data that doesn’t need to be automatically sent to the server and for data that should persist across browser sessions.
In many cases, you might use both cookies and local storage, depending on the specific requirements of different parts of your application. There are also other places where you can store the client-side data. You can check out [this article](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Client-side_web_APIs/Client-side_storage) for more information.
Happy coding 🧑🏽‍💻

BIN
docs/en/Community-Articles/2024-10-09-Cookies-vs-Local-Storage/cover.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 KiB

96
docs/en/Community-Articles/2024-10-09-NET9-Performance-Improvements/Post.md

@ -0,0 +1,96 @@
# .NET 9 Performance Improvements Summary
With every release, .NET becomes faster & faster! You get these improvements for free by just updating your project to the latest .NET!
![Cover Image](cover.png)
It’s very interesting that **20% of these improvements** are implemented by **open-source volunteers** rather than Microsoft employees. These improvements mostly focus on cloud-native and high-throughput applications. I’ll briefly list them below.
![From Microsoft Blog Post](cited-from-microsoft-blog-post.png)
## 1. Dynamic PGO with JIT Compiler
* ### What is dynamic PGO?
With “Profile Guided Optimization” the compiler optimizes the code, based on the flow and the way the code executes. It is predicated on the idea that every potential behavior of the code will always transpire.
* ### What’s Improved?
The tiered compilation, inlining, and dynamic PGO are three ways that .NET 9 optimizes the JIT compiler. This enhances runtime performance and speeds up the time for apps to launch.
* ### Performance Gains
CPU use is lower during execution; therefore, **startup times are about 15% faster**.
* ### As a Developer
Faster, smoother deployments with reduced warm-up times... These enhancements reduce latency for applications with complex workflows, particularly in microservices and high-throughput environments.
* ### How to activate Dynamic PGO?
Add the following to your `csproj` file, or if you have several `csproj` files, you can add it once in `Directory.Build.props` file. Check out [this link](https://learn.microsoft.com/en-us/dotnet/core/runtime-config/compilation#profile-guided-optimization) to understand PGO.
```xml
<PropertyGroup>
<TieredPGO>true</TieredPGO>
</PropertyGroup>
```
## 2. Library Improvements
* ### What’s Improved?
LINQ and JSON serialization, collections and libraries are significantly improved with .NET 9.
* ### Performance Gains
**JSON serialization** performance **increases by about 35%**. This helps with heavy data parsing and API requests. Less memory is allocated to `Span` operations as well, and LINQ techniques such as `Where` and `Select` are now faster.
* ### As a Developer
This means that apps will be faster, especially those that handle data primarily in JSON or manipulate data with LINQ.
## 3. ASP.NET Core
* ### What’s Improved?
Kestrel server has undergone significant modifications, mostly in processing the HTTP/2 and HTTP/3 protocols.
* ### Performance Gains
Now, **Kestrel handles requests up to 20% faster** and **has a 25% reduction in average latency**. Improved connection management and SSL processing also result in overall efficiency gains.
* ### As a Developer
These modifications result in less resource use, quicker response times for web applications, and more seamless scaling in high-traffic situations.
## 4. Garbage Collection & Memory Management
* ### What’s Improved?
NET 9’s garbage collection (GC) is more effective, especially for apps with high allocation rates.
* ### Performance Gains
Applications experience smoother **garbage collection cycles with 8–12% less memory overhead**, which lowers latency and delays.
* ### As a Developer
The performance will be more reliable and predictable for developers as there will be fewer memory-related bottlenecks, particularly in applications that involve frequent object allocations.
## 5. Native AOT Compilation
* ### What’s Improved?
Native AOT (Ahead-of-Time) compilation is now more efficient by lowering memory footprint and cold-start times. This leads to better support for cloud-native applications.
* ### Performance Gains
Native AOT apps now have faster cold launches and use **30–40% less memory**. This improvement focuses on containerized applications.
---
**References:**
* [Microsoft .NET blog post](https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-9/).
* [What’s new in the .NET 9 runtime?](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-9/runtime#performance-improvements)

BIN
docs/en/Community-Articles/2024-10-09-NET9-Performance-Improvements/cited-from-microsoft-blog-post.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

BIN
docs/en/Community-Articles/2024-10-09-NET9-Performance-Improvements/cover.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 KiB

138
docs/en/Community-Articles/2024-10-11-NET-Aspire-vs-ABP-Studio/POST.md

@ -0,0 +1,138 @@
# .NET Aspire vs ABP Studio: Side by Side
In this article, I will compare [.NET Aspire](https://learn.microsoft.com/en-us/dotnet/aspire/) by [ABP Studio](https://abp.io/docs/latest/studio) by explaining their similarities and differences.
![cover](cover.png)
## Introduction
While .NET Aspire and ABP Studio are tools for different purpose with different scope and they have different approaches to solve the problems, many developers still may confuse since they also have some similar functionalities and solves some common problems.
In this article, I will clarify all, and you will have a clear understanding of what are the similarities and differences of them. Let's start by briefly define what are .NET Aspire and ABP Studio.
### What is .NET Aspire?
**[.NET Aspire](https://learn.microsoft.com/en-us/dotnet/aspire/)** is a **cloud-ready framework** designed to simplify building distributed, observable, and production-ready applications. It provides a set of opinionated tools and NuGet packages tailored for cloud-native concerns like **orchestration**, **service integration** (e.g., Redis, PostgreSQL), and **telemetry**. Aspire focuses on the **local development experience**, making it easier to manage complex, multi-service apps by **abstracting away configuration details**.
Here, a screenshot from [.NET Aspire dashboard](https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/dashboard/overview) that is used for application monitoring and inspection:
![dotnet-aspire-dashboard](dotnet-aspire-dashboard.png)
### What is ABP Studio?
**[ABP Studio](https://abp.io/docs/latest/studio)** is a cross-platform **desktop application** designed to **simplify development** on the ABP Framework by **automating various tasks** and offering a streamlined, **integrated development environment**. It allows developers to **build**, **run**, **test**, **monitor**, and **deploy applications** more efficiently. With features like Kubernetes integration and support for complex multi-application systems, ABP Studio **enhances productivity**, especially in **microservice or modular monolith architectures**.
Here, a screenshot from the ABP Studio [Solution Runner panel](https://abp.io/docs/latest/studio/running-applications) that is used to run, browse, monitor and inspect applications:
![abp-studio-solution-runner](abp-studio-solution-runner.png)
## A Brief Comparison
Before deep diving details, I want to show a **table of features** to compare ABP Studio and .NET Aspire side by side:
![abp-studio-vs-net-aspire-comparison-table](abp-studio-vs-dotnet-aspire-comparison-table.png)
## Comparing the Features
In the next sections, I will go through each feature and explain differences and similarities.
### Integration Packages
ABP Framework has tens of integration packages to 3rd-party libraries and services. .NET Aspire also has some library integrations. But these integrations have different purposes:
* **ABP Framework**'s integrations (like [MongoDB](https://abp.io/docs/latest/framework/data/mongodb), [RabbitMQ](https://abp.io/docs/latest/framework/infrastructure/background-jobs/rabbitmq), [Dapr](https://abp.io/docs/latest/framework/dapr), etc) are integrations for its abstractions and aimed to be **used directly by your application code**. They are complete and sophisticated integrations with the ABP Framework and your codebase.
* **.NET Aspire**'s integrations (like [MongoDB](https://learn.microsoft.com/en-us/dotnet/aspire/database/mongodb-integration), [RabbitMQ](https://learn.microsoft.com/en-us/dotnet/aspire/messaging/rabbitmq-integration), [Dapr](https://learn.microsoft.com/en-us/dotnet/aspire/frameworks/dapr), etc), on the other hand, for simplifying configuration, service discovery, orchestration and monitoring of these tools within .NET Aspire host. Basically, these are mostly for **integrating to .NET Aspire**, not for integrating to your application.
For example, ABP's [MongoDB](https://abp.io/docs/latest/framework/data/mongodb) integration allows you to use MongoDB over [repository services](https://abp.io/docs/latest/framework/architecture/domain-driven-design/repositories), automatically handles database transactions, [audit logs](https://abp.io/docs/latest/framework/infrastructure/audit-logging), [event publishing](https://abp.io/docs/latest/framework/infrastructure/event-bus/distributed) on data saves, dynamic [connection string](https://abp.io/docs/latest/framework/fundamentals/connection-strings) management, [multi-tenancy](https://abp.io/docs/latest/framework/architecture/multi-tenancy) integration and so on.
On the other hand, .NET Aspire's [MongoDB](https://learn.microsoft.com/en-us/dotnet/aspire/database/mongodb-integration) integration basically adds [MongoDB driver library](https://www.nuget.org/packages/MongoDB.Driver/) to your .NET Aspire host application and configures it so you can discover MongoDB server on runtime, use a MongoDB Docker container and see its health status, logs and traces on .NET Aspire dashboard.
### Starter Templates
Both of ABP Studio and .NET Aspire provide **startup solution templates for new applications**. However, there are huge differences between these startup solution templates and their purpose are completely different.
* ABP Studio provides **production-ready** and [advanced solution templates](https://abp.io/docs/latest/solution-templates) for **layered**, **modular** or **microservice** solution development. They are well configured for **local development** and deploying to **Kubernetes** and other **production environments**. They provide different **UI and database options**, many optional modules and configuration. For example, you can check the [microservice solution template](https://abp.io/docs/latest/solution-templates/microservice/overview) to see how **sophisticated** it is.
* .NET Aspire's [project templates](https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/setup-tooling?tabs=windows&pivots=visual-studio#net-aspire-project-templates)' main purpose is to provide a minimal application structure that is **pre-integrated to .NET Aspire** libraries and configured for **local development** environment.
So, when you start with .NET Aspire project template, you will need to deal with a lot of work to make your solution production and enterprise ready. On the other hand, ABP Studio's solution templates are ready to launch your system from the first day and they provide you a perfect starting point for your new business idea.
### Monitoring & Application Running
Monitoring applications and services is an important requirement for building **complex distributed systems**. Both of ABP Studio and .NET Aspire provide **excellent tools** for that purpose.
* ABP Studio's [Solution Runner panel](https://abp.io/docs/latest/studio/running-applications) provides a powerful UI to run and monitor applications and services. You can see all HTTP requests, distributed events, exceptions and detailed application logs, trace and find problems in your system. You can use its fully functional built-in browser to navigate application UIs easily. You can also create multiple profiles to group and configure the applications for different teams.
* .NET Aspire's [dashboard](https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/dashboard/overview) can be used to see the states of the running applications and containers, explore their console output, logs, traces and metrics to understand what is happing in your distributed system.
Both tools are pretty useful for monitoring. In addition to monitoring, **ABP Studio offers an advanced UI to control the running applications**, build, start and stop individually or by a group of applications.
### Architecting / Building Solutions
One of the unique features of **ABP Studio** is that it **is an architectural tool** that helps you create the structure and architecture of your solution. You can create any kind of application, from **single-layer** simple web applications to **layered multi-application** solutions, from **monolith modular** to **microservice** systems. In the next section, I will briefly explains these architectural features.
#### Building Modular Monolith Solutions
With ABP Studio, you can create a new solution, **create modules and establish relations** (dependencies) between modules to architect your overall **modular monolith system** easily.
Here, a screenshot where we are adding an existing package reference to the Products module of a modular CRM solution:
![abp-studio-add-existing-package](abp-studio-add-existing-package.png)
You can see the [Modular Application Development tutorial](https://abp.io/docs/latest/tutorials/modular-crm) to learn how to build such an application step by step.
#### Building Microservice Solutions
ABP Studio provides a full featured [microservice startup solution template](https://abp.io/docs/latest/solution-templates/microservice) and the fundamental tooling to build **large-scale microservice systems**.
Here a screenshot that shows how to add new microservices, API gateways or web applications to a microservice solution:
![abp-studio-add-new-microservice](abp-studio-add-new-microservice.png)
.NET Aspire has no such a feature and has no such a plan to provide that kind of architectural solution building experience.
### Kubernetes Integration
Another great ABP Studio feature is [Kubernetes Integration](https://abp.io/docs/latest/studio/kubernetes). It allows you to develop your distributed / microservice solutions as integrated to [Kubernetes](https://kubernetes.io/).
Here, a few tasks you can accomplish using ABP Studio's Kubernetes integration:
* **Build docker images** of your applications and services
* **Install and uninstall Helm charts** to your Kubernetes cluster
* **Connect to internal services** of your Kubernetes cluster
* **Monitor** services and applications that are running in your Kubernetes cluster
* **Intercept traffic** of a service and redirect requests to your local machine. In that way, you can develop, test and run individual services or applications in your local computer that is **fully integrated** to other services and applications running in Kubernetes.
ABP Studio's Kubernetes Integration makes microservice development so easy and comfortable. On the other hand, .NET Aspire has no such a Kubernetes integrated development experience.
## The ABP Platform
Until now, I directly compared ABP Studio and .NET Aspire features. .NET Aspire is directly built on .NET and ASP.NET Core. However, ABP Studio is not a standalone tool that is built on .NET and ASP.NET Core. It is built on the [ABP Platform](https://abp.io/) (which is built on .NET and ASP.NET Core).
The following diagram shows ABP Platform components at a glance:
![abp-overall-diagram](abp-overall-diagram.png)
So, when you use ABP Studio, you also take full power of the [open source ABP Framework](https://github.com/abpframework/abp) and other ABP Platform features.
## ABP and .NET Aspire Integration
I have a good news to you. It is actually possible and pretty easy to make ABP Platform and .NET Aspire working together.
You can check [@berkansasmaz](https://abp.io/community/members/berkansasmaz)'s great article: **[How to use .NET Aspire with ABP framework](https://abp.io/community/articles/how-to-use-.net-aspire-with-abp-framework-h29km4kk)**.
## Licensing
ABP Studio has a Community Edition which is completely free and available to everyone. It includes many of the features I mentioned here. There is also a commercial edition that is included in [commercial ABP licenses](https://abp.io/pricing). You can [check that blog post](https://abp.io/blog/announcing-abp-studio-general-availability) which clearly explains the license differences and introduces the fundamental ABP Studio features.
On the other hand, .NET Aspire is a free tool developed and published by Microsoft. It has no commercial version.
## Conclusion
Both .NET Aspire and ABP Studio serve distinct purposes, catering to different types of development environments. While .NET Aspire excels in simplifying cloud-native application setups and observability, ABP Studio provides a comprehensive framework for modular monoliths and microservice architectures with full-fledged enterprise level production-ready startup solution templates and integrated tools.
In the previous section, it was mentioned that it is possible to [use them together](https://abp.io/community/articles/how-to-use-.net-aspire-with-abp-framework-h29km4kk). You don't have to select one of them. However, in my opinion, when you use ABP Studio, you won't need .NET Aspire since ABP Studio can do everything and much more. If you have budget, I suggest to purchase a commercial ABP Studio [license](https://abp.io/pricing) so you can fully unlock its power.
## Resources / Further Reading
* [ABP Studio documentation](https://abp.io/docs/latest/studio)
* [.NET Aspire documentation](https://learn.microsoft.com/en-us/dotnet/aspire/)
* [How to use .NET Aspire with ABP framework](https://abp.io/community/articles/how-to-use-.net-aspire-with-abp-framework-h29km4kk)

BIN
docs/en/Community-Articles/2024-10-11-NET-Aspire-vs-ABP-Studio/abp-overall-diagram.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 KiB

BIN
docs/en/Community-Articles/2024-10-11-NET-Aspire-vs-ABP-Studio/abp-studio-add-existing-package.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
docs/en/Community-Articles/2024-10-11-NET-Aspire-vs-ABP-Studio/abp-studio-add-new-microservice.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
docs/en/Community-Articles/2024-10-11-NET-Aspire-vs-ABP-Studio/abp-studio-solution-runner.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

BIN
docs/en/Community-Articles/2024-10-11-NET-Aspire-vs-ABP-Studio/abp-studio-vs-dotnet-aspire-comparison-table.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

BIN
docs/en/Community-Articles/2024-10-11-NET-Aspire-vs-ABP-Studio/cover.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 KiB

BIN
docs/en/Community-Articles/2024-10-11-NET-Aspire-vs-ABP-Studio/dotnet-aspire-dashboard.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
docs/en/Community-Articles/2024-10-23-Abp-Net9-Upgrade/cover.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

BIN
docs/en/Community-Articles/2024-10-23-Abp-Net9-Upgrade/dog-food.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

BIN
docs/en/Community-Articles/2024-10-23-Abp-Net9-Upgrade/ef-core-upgrade.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

BIN
docs/en/Community-Articles/2024-10-23-Abp-Net9-Upgrade/net-support-policy.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

147
docs/en/Community-Articles/2024-10-23-Abp-Net9-Upgrade/post.md

@ -0,0 +1,147 @@
# ABP Now Supports .NET 9
![Cover image](cover.png)
**.NET 9.0.100-rc.2** has been released on **October 8, 2024**. To align with the latest .NET, we also released the ABP Platform [9.0.0-rc.1](https://github.com/abpframework/abp/releases/tag/9.0.0-rc.1) version.
**With this release, ABP now supports .NET 9.**
The .NET 9 stable version is planned to be released on **November 12, 2024** before the [.NET Conf 2024](https://www.dotnetconf.net/) event. The ABP 9.0 stable version is planned to be released on November 19, 2024.
---
- **Download the .NET 9 runtime** and SDK from the following link:
[https://dotnet.microsoft.com/en-us/download/dotnet/9.0](https://dotnet.microsoft.com/en-us/download/dotnet/9.0)
- There are many enhancements and bug fixes with ABP 9.0. Read the ABP 9 announcement:
https://abp.io/blog/announcing-abp-9-0-release-candidate
-
Read **our migration ABP 9.0 migration guide** from the following link:
[abp.io/docs/9.0/release-info/migration-guides/abp-9-0](https://abp.io/docs/9.0/release-info/migration-guides/abp-9-0)
- The following is the **PR is for the .NET 9 upgrade** in the ABP source code:
[https://github.com/abpframework/abp/pull/20803](https://github.com/abpframework/abp/pull/20803)
---
## .NET 9 Releases
In the following link, you can find **a list of all .NET 9 releases** with direct links to release notes and announcements/discussions:
* https://github.com/dotnet/core/discussions/9234
---
## ABP Supports Both .NET 8 & .NET 9
The ABP 9.0 version fully supports .NET 9 within our new templates and modules. For developers who want to update their ABP packages to the latest but want to keep them in .NET 8, **we support both .NET 8 and .NET 9** in ABP 9. In your host application, you can choose your target framework.
So you can decide which version you want to use in your startup Host Application’s `<TargetFramework>` tag.
In [this link](https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp/Volo.Abp.csproj#L7) you can see that netstandard2.0/2.1 and net8/9 are supported.
```xml
<Project Sdk="Microsoft.NET.Sdk">
<TargetFrameworks>
netstandard2.0;netstandard2.1;net8.0;net9.0
</TargetFrameworks>
</Project>
```
### New ASP.NET Core Middleware: Static Asset Delivery
`MapStaticAssets` is a new middleware that helps optimize the delivery of static assets in any ASP.NET Core app, including Blazor apps. With this change, some `JavaScript/CSS/Images` files exist in the [Virtual File System](https://abp.io/docs/latest/framework/infrastructure/virtual-file-system?_redirected=B8ABF606AA1BDF5C629883DF1061649A), but the new ASP.NET Core 9 `MapStaticAssets` can't handle them. You need to add `StaticFileMiddleware` to serve these files. In ABP 9, we added `MapAbpStaticAssetsan `extension method to support the new `MapStaticAssets`. You can read about this new feature at [this link](https://learn.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-9.0?view=aspnetcore-8.0#static-asset-delivery-optimization).
ABP’s new extension method is available [here](https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Builder/AbpApplicationBuilderExtensions.cs#L129-L198).
---
## How to Upgrade from .NET 8 to .NET 9:
Install the latest .NET 9 SDK from [this link](https://dotnet.microsoft.com/en-us/download/dotnet/9.0).
Upgrade [dotnet-ef](https://learn.microsoft.com/en-us/ef/core/cli/dotnet) tool version with the following command:
```bash
dotnet tool uninstall --global dotnet-ef && dotnet tool install --global dotnet-ef
```
![EF Core Upgrade](ef-core-upgrade.png)
1. Change all `TargetFramework` tags from `net8.0` to `net9.0`.
2. Upgrade all Microsoft NuGet packages to `9.0.0`.
3. If you have `global.json`, update `dotnet`version to `9.0.0` .
4. Replace`app.UseStaticFiles()` to `app.MapAbpStaticAssets()` in your module classes and startup projects.
[See the related changes in the repository.](https://github.com/abpframework/abp/commit/0f34f6dfcdbeb5d27fd63cf764f1ef13eb9cdfcd)
---
## What’s new with .NET 9
**.NET 9 Blazor New Features**
- https://abp.io/community/articles/asp.net-core-blazor-9.0-new-features-summary--x0fovych
**.NET 9 Performance Improvements Summary**
- https://abp.io/community/articles/.net-9-performance-improvements-summary-gmww3gl8
**What’s new in .NET 9 (Microsoft’s post)**
- https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-9/overview
---
## We Are Eating Our Own Dog Food
Before we release any version of ABP, **we test our upcoming version** on our sample apps and live website https://abp.io. The ABP.io website is also built on top of the ABP Framework, and you can see that we have already started to use .NET 9-rc.2 on our live website.
![Eating our own dog food](dog-food.png)
---
## Microsoft .NET Support Policy
Lastly, I want to mention Microsoft's .NET support policy.
- **.NET 7** support has been **finished** on **May 2024**.
- **.NET 8** will be supported until **November 2026**.
- **.NET 9** is on the standard term support, which means Microsoft will release patches until **May 2026**.
Find detailed information about the .NET support policy at [this link.](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core)
![.NET Core Official Support Policy](net-support-policy.png)
---
## Finally
.NET 9 is making a significant impact. It introduces features like Native AOT for faster applications, enhanced AI integration and improved tools for cloud-native and cross-platform development, all aimed at simplifying developers’ work. Whether you’re handling small projects or large-scale enterprise applications, it offers enhancements that **elevate your productivity by just upgrading your .NET version to 9.0**

125
docs/en/Community-Articles/2024-11-01-Hybrid-Cache-Net-9/POST.md

@ -0,0 +1,125 @@
# Hybrid Cache in .NET 9
.NET 9 introduces an exciting feature: **HybridCache**, an advanced caching mechanism that seamlessly combines multiple caching strategies to maximize performance and scalability.
It offers a flexible caching solution that combines the best aspects of local and distributed caching. **HybridCache** is particularly useful in scenarios where quick, in-memory access is desirable but data consistency across multiple application instances is also a requirement.
In this article, we’ll explore **HybridCache** in .NET 9 and how it integrates with ABP Framework using `AbpHybridCache`. This new feature offers a robust solution for applications that need to scale while maintaining efficient caching strategies.
## What is HybridCache?
**HybridCache** is designed to merge different caching layers, commonly including an in-memory cache (for high-speed access) and a distributed cache (for scalability across multiple instances). This hybrid approach allows for:
* **Improved Performance**: Frequently accessed data is stored in-memory, reducing latency.
* **Increased Scalability**: Cached data can still be shared across distributed environments, essential for load-balanced applications.
* **Automatic Synchronization**: Changes in distributed cache automatically update the in-memory cache, ensuring data consistency.
## Using HybridCache with ABP
> For more information about the implementation in the ABP side, you can refer to the pull request [here](https://github.com/abpframework/abp/pull/20859).
ABP's support for **HybridCache** is available starting from version 9.0 through the [`AbpHybridCache`](https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/Hybrid/AbpHybridCache.cs) implementation. By leveraging this feature, developers using ABP can implement hybrid caching in a way that aligns with ABP’s modular and extensible architecture.
To demonstrate how to use **HybridCache** in ABP, let's start with a simple example.
> You can create an ABP-based application with v9.0+, and then follow the next steps for using hybrid caching in your application.
### Configuring the `AbpHybridCacheOptions` (Optional)
First, you can configure the hybrid cache options in your module class as below (it's optional):
```csharp
using Microsoft.Extensions.Caching.Hybrid;
using Volo.Abp.Caching.Hybrid;
public class YourModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
//...
Configure<AbpHybridCacheOptions>(options =>
{
//configuring the global hybrid cache options
options.GlobalHybridCacheEntryOptions = new HybridCacheEntryOptions()
{
Expiration = TimeSpan.FromMinutes(20),
LocalCacheExpiration = TimeSpan.FromMinutes(10)
};
});
}
}
```
* You can configure the `AbpHybridCacheOptions` to set *keyPrefix* for your cache keys, throw or hide exceptions for the distributed cache (by default *it hides errors*), or configure cache for specific cache item keys and more...
* By setting the `GlobalHybridCacheEntryOptions`, you specify the caching options globally in your application. Thanks to that, you don't need to manually pass the related options whenever you use the `IHybridCache` service.
### Using the `IHybridCache` Service
After the configuration, now you can inject the `IHybridCache` and use it to set and retrieve cache values:
```csharp
using Volo.Abp.Caching.Hybrid;
public class BookAppService : ApplicationService, IBookAppService
{
private readonly IHybridCache<BookCacheItem> _hybridCache;
public BookAppService(IHybridCache<BookCacheItem> hybridCache)
{
_hybridCache = hybridCache;
}
public async Task<BookCacheItem> GetBookWithPageCountAsync(string name)
{
var cacheKey = "cacheKey:book-" + name;
// Retrieve data from hybrid cache
return await _hybridCache.GetOrCreateAsync(cacheKey, async () =>
{
// Simulating getting and returning the data if not exist in the cache
return new BookCacheItem
{
Name = name,
PageCount = 100
};
});
}
}
public class BookCacheItem
{
public string Name { get; set; }
public int PageCount { get; set; }
}
```
* You can use the `IHybridCache<TCacheItem>` or `IHybridCache<TCacheItem, TCacheKey>` service to leverage the hybrid caching. If you use `IHybridCache<TCacheItem>`as the service, then you should pass the cache key as *string* like in the example above.
* In this example, you used the `GetOrCreateAsync` method, which first tries to get the cache item with the provided cache key, if there is no cache with the specified key, then it runs the factory method and add the returned data to the cache.
* Alternatively, you can use the `SetAsync` method to set the cache item.
### Debugging the `IHybridCache` Service (deep-dive)
When you debug the `IHybridCache` service, you'll notice the L1 and L2 cache stores. (L1 is in-memory cache store and L2 is the distributed cache store):
![](debug-hybrid-cache.png)
As you can see from the figure, it only set the cache item to the **LocalCache** (`MemoryCache`) and did not set the **BackendCache** (`DistributedCache`) because I did not configure the distributed cache and not running my application in multiple instances. But as you can notice, even without an `IDistributedCache` configuration, the `HybridCache` service will still provide in-process caching.
**Note:** If you configure distributed caching options, `HybridCache` service uses the distributed cache and sets the **BackendCache**.
## Conclusion
The **HybridCache** library in .NET 9 provides a powerful tool for applications needing both high-speed caching and consistency in distributed environments.
With ABP Framework’s `AbpHybridCache` support, integrating this feature into an ABP-based application becomes straightforward. This setup helps ensure that cached data remains synchronized across instances, bringing a new level of flexibility to caching in .NET 9 applications.
> For more information, you can refer to the [Microsoft's official document](https://learn.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-9.0?view=aspnetcore-9.0#new-hybridcache-library).
## References
- https://learn.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-9.0?view=aspnetcore-9.0#new-hybridcache-library
- https://www.youtube.com/watch?v=TDyZc11cJfA
- https://github.com/abpframework/abp/pull/20803
- https://github.com/abpframework/abp/pull/20859

BIN
docs/en/Community-Articles/2024-11-01-Hybrid-Cache-Net-9/cover-image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 483 KiB

BIN
docs/en/Community-Articles/2024-11-01-Hybrid-Cache-Net-9/debug-hybrid-cache.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

86
docs/en/Community-Articles/2024-11-04-EF Core 9 Read-only-Primitive-Collections/POST.md

@ -0,0 +1,86 @@
# EF Core 9 Read-only Primitive Collections
In this article, we will explore the new features introduced in EF Core 9, specifically focusing on Read-only Primitive Collections. EF Core 8 introduced support for mapping arrays and mutable lists of primitive types, and you can read more about it [here](https://abp.io/community/articles/ef-core-8-primitive-collections-ttn5b6xp). This has been expanded in EF Core 9 to include read-only collections/lists. Specifically, EF Core 9 supports collections typed as `IReadOnlyList`, `IReadOnlyCollection`, or `ReadOnlyCollection`.
## Introduction to EF Core 9 Read-only Primitive Collections
Entity Framework Core 9 introduces several enhancements, one of which is the support for Read-only Primitive Collections. This feature aims to provide better support for scenarios where collections of primitive types, such as `int`, `string`, or `bool`, need to be used in a read-only manner in your entity classes. Previously, developers had to use complex workarounds to ensure collections couldn't be modified, but EF Core 9 now provides a simpler, built-in solution to handle this more effectively.
### Why Read-only Primitive Collections Matter
Read-only Primitive Collections are particularly useful when you need to guarantee the integrity of certain data within your entities. For example, imagine you have a `Car` entity that has a collection of `Colors`, represented as a set of enums. You might not want these colors to be modified after they're initially set, ensuring that any business logic reliant on these values remains consistent.
EF Core 9 introduces a convenient way to define these collections as read-only, helping developers maintain stricter control over their data.
### How It Works
Defining a read-only primitive collection is quite straightforward in EF Core 9. You can use the `IReadOnlyList<T>`, `IReadOnlyCollection<T>`, or `ReadOnlyCollection<T>` types to declare your properties, ensuring a consistent read-only behavior. This helps maintain data integrity by preventing modifications after the collection is set. Below is an example that includes a `Car` class and a `Color` enum. The `Car` class has a `Colors` property that holds a read-only list of available colors, ensuring that these values cannot be modified after being initially set:
```csharp
public enum Color
{
Black,
White,
Red,
Blue
}
public class Car
{
public int Id { get; set; }
public string Brand { get; set; }
public string Model { get; set; }
public IReadOnlyList<Color> Colors { get; private set; } = new List<Color> { Color.Black, Color.White }.AsReadOnly();
protected Car()
{
/* This constructor is for deserialization / ORM purpose */
}
public Car(string brand, string model, IEnumerable<Color> colors)
{
Brand = brand;
Model = model;
Colors = colors.ToList().AsReadOnly();
}
}
```
In the example above, `Colors` is defined as a read-only list, preventing any accidental modifications once it is set. This ensures that data integrity is maintained without the need for manual validation.
To query cars with specific colors, you can use the following example:
```csharp
var colors = new List<Color> { Color.Black, Color.White };
var cars = await context.Cars
.Where(c => c.Colors.Intersect(colors).Any())
.ToListAsync();
```
The query selects all cars that have any of the specified colors in their `Colors` collection.
The SQL result looks like this; as you can see, it sends colors as parameters instead of adding them inline. It also uses the `json_each` function to deserialize on the database side:
```sql
SELECT "c"."id",
"c"."brand",
"c"."colors",
"c"."model"
FROM "cars" AS "c"
WHERE EXISTS (SELECT 1
FROM (SELECT "c0"."value"
FROM Json_each("c"."colors") AS "c0"
INTERSECT
SELECT "c1"."value"
FROM Json_each(@__colors_0) AS "c1") AS "i")
```
### Conclusion
Read-only primitive collections make it easier to enforce data integrity by preventing changes to your collection data. This feature helps simplify your code while ensuring that critical parts of your data remain consistent.
## References
- https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-9.0/whatsnew#read-only-primitive-collections
- https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-8.0/whatsnew#primitive-collections
- https://abp.io/community/articles/ef-core-8-primitive-collections-ttn5b6xp

54
docs/en/Community-Articles/2024-11-05-.NET Aspire 9.0 Features/Post.md

@ -0,0 +1,54 @@
# .NET Aspire 9.0 Features
.NET Aspire 9.0 is the next major release, supporting both .NET 8 and .NET 9. This version includes new features and improvements.
## Upgrade to .NET Aspire
Now, you don't need workloads to develop .NET Aspire applications. In your project, you can add an SDK reference to `Aspire.AppHost.Sdk`.
For more information, you can check out [https://learn.microsoft.com/en-us/dotnet/aspire/whats-new/dotnet-aspire-9?tabs=windows#upgrade-to-net-aspire-9](https://learn.microsoft.com/en-us/dotnet/aspire/whats-new/dotnet-aspire-9?tabs=windows#upgrade-to-net-aspire-9) which explains upgrading an existing project in details.
## Dashboard
.NET Aspire offers a nice dashboard for developers to observe the performance and behavior of their applications. In this version, there are some enhancements;
* **Manage resource lifecycle**: You can stop, start, and restart resources.
* **Mobile and responsive support**: The .NET Aspire dashboard is now mobile-friendly.
* **Sensitive properties**: Properties can be marked as sensitive, automatically masking them in the dashboard UI.
* **Volumes**: Configured container volumes are listed in resource details.
* **Health checks**: .NET Aspire 9 adds support for health checks.
![Resource Lifecycle](./aspire_resource_lifecycle.jpg)
## Telemetry
.NET Aspire 9 comes with many new features to the Telemetry service.
* **Improve telemetry filtering**: Telemetry data can now be filtered by attribute values.
* **Combine telemetry from multiple resources**: If a resource has multiple replicas, you can now filter telemetry data to view from all instances.
* **Browser telemetry support**: The dashboard now supports OpenTelemetry Protocol (OTLP) over HTTP and cross-origin resource sharing (CORS).
![Telemetry Filtering](./aspire_trace_filter.jpg)
## Orchestration
The .NET App Host is a core component of the .NET runtime that helps launch and execute .NET applications.
.NET Aspire 9 introduces many new features to the app host. Let's take a look;
* **Waiting for dependencies**: You can configure a resource to wait for another resource to start before starting.
* **Resource health checks**: The `Waiting for dependencies` feature uses health checks to determine if a resource is ready.
## Integrations
.NET Aspire has integrations with some services and tools that make it easy to get started. New integrations are coming with .NET Aspire 9.
* Redis Insight
* OpenAI (Preview)
* MongoDB
* Azure
For Azure part, it is better to check the official documentation here [https://learn.microsoft.com/en-us/dotnet/aspire/whats-new/dotnet-aspire-9-release-candidate-1?tabs=windows&pivots=visual-studio#azure](https://learn.microsoft.com/en-us/dotnet/aspire/whats-new/dotnet-aspire-9-release-candidate-1?tabs=windows&pivots=visual-studio#azure) because it has a very detailed explanation.
## ABP Studio
.NET Aspire and [ABP Studio](https://abp.io/studio) are tools for different purposes with different scopes, and they have different approaches to solving problems; many developers may still be confused since they also have some similar functionalities and solve some common problems. You can check the comparison of .NET Aspire and ABP Studio in this [article](https://abp.io/community/articles/.net-aspire-vs-abp-studio-side-by-side-t1c73d1l).

BIN
docs/en/Community-Articles/2024-11-05-.NET Aspire 9.0 Features/aspire_resource_lifecycle.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

BIN
docs/en/Community-Articles/2024-11-05-.NET Aspire 9.0 Features/aspire_trace_filter.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

113
docs/en/Community-Articles/2024-11-05-SignalR-supports-trimming-and-Native-AOT/POST.md

@ -0,0 +1,113 @@
# SignalR supports trimming and Native AOT
## What is SignalR?
SignalR is a library that allows you to add real-time web functionality to your applications. It provides a simple API for creating server-to-client remote procedure calls (RPC) that can be called from the server and client. Now SignalR supports trimming and Native AOT in .NET 8.0 and .NET 9.0. You can learn more about [SignalR new features](https://abp.io/community/articles/asp.net-core-signalr-new-features-summary-kcydtdgq) in this article.
## What is trimming and Native AOT?
AOT (Ahead-of-Time) compilation is a feature that allows you to compile your application into native code before running it. This can help improve performance and reduce startup times. Trimming is a feature that allows you to remove unused code from your application, reducing its size and improving performance. You can learn more about [Native AOT Compilation](https://abp.io/community/articles/native-aot-compilation-in-.net-8-oq7qtwov) in this article.
## How to use SignalR with trimming and Native AOT?
You can create ASP.NET Core AOT application with using the following command:
```bash
dotnet new webapiaot -n Acme.Sample
```
The created application uses `CreateSlimBuilder` method to create minimal builder for the application. You can use `CreateBuilder` method to create a builder with all the services registered. However, deploying an application with `CreateSlimBuilder` method is more convenient because it reduces the size of the application. You can learn more about [CreateSlimBuilder vs CreateBuilder](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/native-aot#createslimbuilder-vs-createbuilder).
Replace the `Program.cs` file with the following code:
```csharp
using Microsoft.AspNetCore.SignalR;
using System.Text.Json.Serialization;
var builder = WebApplication.CreateSlimBuilder(args);
builder.Services.AddSignalR();
builder.Services.Configure<JsonHubProtocolOptions>(o =>
{
o.PayloadSerializerOptions.TypeInfoResolverChain.Insert(0, AppJsonSerializerContext.Default);
});
var app = builder.Build();
app.MapHub<ChatHub>("/chatHub");
app.MapGet("/", () => Results.Content("""
<!DOCTYPE html>
<html>
<head>
<title>SignalR Chat</title>
</head>
<body>
<input id="userInput" placeholder="Enter your name" />
<input id="messageInput" placeholder="Type a message" />
<button onclick="sendMessage()">Send</button>
<ul id="messages"></ul>
<script src="https://cdnjs.cloudflare.com/ajax/libs/microsoft-signalr/8.0.7/signalr.min.js"></script>
<script>
const connection = new signalR.HubConnectionBuilder()
.withUrl("/chatHub")
.build();
connection.on("ReceiveMessage", (user, message) => {
const li = document.createElement("li");
li.textContent = `${user}: ${message}`;
document.getElementById("messages").appendChild(li);
});
async function sendMessage() {
const user = document.getElementById("userInput").value;
const message = document.getElementById("messageInput").value;
await connection.invoke("SendMessage", user, message);
}
connection.start().catch(err => console.error(err));
</script>
</body>
</html>
""", "text/html"));
app.Run();
[JsonSerializable(typeof(string))]
internal partial class AppJsonSerializerContext : JsonSerializerContext { }
public class ChatHub : Hub
{
public async Task SendMessage(string user, string message)
{
await Clients.All.SendAsync("ReceiveMessage", user, message);
}
}
```
It is a simple chat application that uses SignalR to send and receive messages.
![chat](chat.png)
Before deploying the application, ensure that **Desktop development with C++** is installed on your machine if you're using Windows OS. For more details, you can check the [pre-requisites](https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot#prerequisites).
You can deploy the application with the following command:
```bash
dotnet publish -c Release
```
### Limitations
Since we are using Native AOT, there are some limitations that you should be aware of:
- **Only the JSON protocol is supported**: For the payload serialization in SignalR, only the JSON protocol is supported. You need to configure the `JsonHubProtocolOptions` to use the `AppJsonSerializerContext` for serialization/deserialization.
- **Reflection**: Native AOT does not support reflection. You need to use the `JsonSerializable` attribute to specify the types that should be serialized/deserialized. In this example, we have used the `JsonSerializable` attribute for the `string` type in the `AppJsonSerializerContext` class.
For more details, you can check the [limitations](https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot#limitations-of-native-aot-deployment) of Native AOT.
## Conclusion
In this article, we learned how to use SignalR with trimming and Native AOT in .NET 8.0 and .NET 9.0. We created a simple chat application that uses SignalR to send and receive messages. We also discussed the limitations of using Native AOT and how to overcome them.
For more information, you can refer to the [Microsoft's official document](https://learn.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-9.0?view=aspnetcore-9.0#signalr-supports-trimming-and-native-aot).

BIN
docs/en/Community-Articles/2024-11-05-SignalR-supports-trimming-and-Native-AOT/chat.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

58
docs/en/Community-Articles/2024-11-06-Keyed-DI-in-Middlewares-Net-9/post.md

@ -0,0 +1,58 @@
# Middleware Now Supports Keyed Dependency Injection in .NET 9
This article explores a new feature in .NET 9 that enables keyed dependency injection in middleware. Previously, .NET 8 introduced keyed services, which allowed developers to register multiple instances of the same service type with distinct keys. Now, .NET 9 extends this feature to middleware, making it easier to inject specific services within the middleware based on defined keys. For more details, see this [overview on the .NET blog](https://github.com/dotnet/core/blob/main/release-notes/9.0/preview/rc1/aspnetcore.md#keyed-di-in-middleware).
## What is Keyed Dependency Injection?
Keyed dependency injection is a technique for registering multiple service versions with unique identifiers, or “keys.” This approach is especially helpful when multiple implementations of the same service are required in different contexts. For example, you may have various logging services but want to inject a specific logger based on the application’s current needs. By using keys, developers can ensure that the appropriate service version is injected precisely where it’s needed.
## Using Keyed Dependency Injection in Middleware
In .NET 9, developers can now use keyed dependency injection directly in middleware. Keyed services can be injected through the middleware constructor or via the `Invoke`/`InvokeAsync` methods, allowing for straightforward and flexible control of service instances in middleware components. Here’s an example of how to configure and use keyed dependency injection in middleware:
```csharp
var builder = WebApplication.CreateBuilder(args);
// Register services with unique keys
builder.Services.AddKeyedSingleton<MySingletonClass>("test");
builder.Services.AddKeyedScoped<MyScopedClass>("test2");
var app = builder.Build();
app.UseMiddleware<MyMiddleware>();
app.Run();
internal class MyMiddleware
{
private readonly RequestDelegate _next;
private readonly MySingletonClass _singletonService;
// Constructor injection with key
public MyMiddleware(RequestDelegate next, [FromKeyedServices("test")] MySingletonClass singletonService)
{
_next = next;
_singletonService = singletonService;
}
// Invoke method with additional scoped service injection using key
public Task Invoke(HttpContext context, [FromKeyedServices("test2")] MyScopedClass scopedService)
{
// Middleware logic here
return _next(context);
}
}
```
In this example:
- `MySingletonClass` and `MyScopedClass` are registered with unique keys (`"test"` and `"test2"`).
- These services are injected into the middleware through both the constructor and `Invoke` method, based on their respective keys.
This approach allows developers to manage which service instances are available within middleware precisely.
## Conclusion
Keyed dependency injection in middleware is a significant addition in .NET 9. It provides developers with more control over which services are injected based on specific keys. This enhancement enables selective service injection in middleware scenarios, allowing for more modular and maintainable applications.
## References
- [.NET 9 Release Notes](https://github.com/dotnet/core/blob/main/release-notes/9.0/preview/rc1/aspnetcore.md#keyed-di-in-middleware)
- [Dependency Injection and Keyed Services](https://learn.microsoft.com/aspnet/core/fundamentals/dependency-injection#keyed-services)

108
docs/en/Community-Articles/2024-11-06-Optimize-static-web-asset-delivery/POST.md

@ -0,0 +1,108 @@
# Optimizing Static Asset Delivery feature in ASP.NET Core 9.0
Delivering static assets efficiently is a key factor in building performant web applications. By optimizing how assets like CSS, JavaScript, and images are served to the browser, you can reduce load times, decrease network traffic, and improve the overall user experience.
One powerful tool to help achieve this is **MapStaticAssets**, a feature in ASP.NET Core that significantly optimizes the delivery of static resources. Whether you're working with Blazor, Razor Pages, MVC, or other UI frameworks, **MapStaticAssets** streamlines asset management and ensures that your web app delivers resources in the most efficient way possible.
## Why Optimizing Static Assets Matters
Serving static assets without optimization can lead to several performance bottlenecks:
- **Excessive network requests**: The browser may need to request the same resources multiple times, even if they haven’t changed.
- **Unnecessary data transfer**: Larger files are sent over the network, consuming bandwidth and slowing down page loads.
- **Outdated assets**: Without proper cache management, users may receive stale versions of files after an app update.
Optimizing static assets involves compressing files, managing caching headers, and ensuring that only the necessary resources are sent to the client. **MapStaticAssets** takes care of all these issues in a seamless, automated way.
## What is MapStaticAssets?
**MapStaticAssets** is designed to enhance the default static asset serving mechanism in ASP.NET Core. It can replace `UseStaticFiles` in most scenarios and comes with several built-in optimizations. These optimizations are executed at both build and publish time, ensuring that static resources are served in the most efficient way possible when your app is running.
Here's how you can implement **MapStaticAssets** in your app:
```csharp
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRazorPages();
var app = builder.Build();
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error");
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseRouting();
app.UseAuthorization();
// Replacing UseStaticFiles with MapStaticAssets
app.MapStaticAssets();
app.MapRazorPages();
app.Run();
```
## Key Features of MapStaticAssets
1. **Build-time Compression**:
**MapStaticAssets** automatically compresses all static assets during the build process. It uses **gzip** compression during development and **gzip + brotli** compression when publishing. This reduces the file size significantly, ensuring faster download times.
For example, in a default Razor Pages template, assets like `bootstrap.min.css` and `jquery.js` are compressed by over 80%, resulting in significantly reduced file sizes:
| File | Original Size | Compressed Size | Compression Reduction |
|----------------------|---------------|-----------------|-----------------------|
| `bootstrap.min.css` | 163 KB | 17.5 KB | 89.26% |
| `jquery.js` | 89.6 KB | 28 KB | 68.75% |
| `bootstrap.min.js` | 78.5 KB | 20 KB | 74.52% |
| **Total** | 331.1 KB | 65.5 KB | 80.20% |
2. **Content-based ETags**:
**MapStaticAssets** generates **ETags** based on the SHA-256 hash of the file content, encoded in Base64. This ensures that the browser only re-downloads a resource if its content has changed. This eliminates unnecessary network requests, improving page load speeds.
3. **Smaller File Sizes for Libraries**:
Popular component libraries, such as **Fluent UI Blazor** and **MudBlazor**, benefit from similar compression optimizations. For example, the size of the **MudBlazor** library is reduced by over 90%, from 588 KB to just 46.7 KB after compression.
| File | Original Size | Compressed Size | Compression Reduction |
|----------------------|---------------|-----------------|-----------------------|
| `MudBlazor.min.css` | 541 KB | 37.5 KB | 93.07% |
| `MudBlazor.min.js` | 47.4 KB | 9.2 KB | 80.59% |
| **Total** | 588.4 KB | 46.7 KB | 92.07% |
4. **Automatic Optimization**:
As libraries or components are added or updated, **MapStaticAssets** automatically optimizes the assets as part of the build process. This includes minimizing the size of JavaScript and CSS files, reducing the impact of mobile or low-bandwidth environments.
5. **Serving Assets with a CDN**:
Although **MapStaticAssets** is focused on server-side optimizations, integrating a **CDN (Content Delivery Network)** can further boost performance by serving static assets from servers geographically closer to the user, reducing latency.
## Comparing MapStaticAssets to IIS Dynamic Compression
**MapStaticAssets** provides several advantages over traditional dynamic compression techniques, such as IIS **gzip** compression:
- **Simplicity**: There is no need for server-specific configuration, making **MapStaticAssets** easy to implement.
- **Performance**: By compressing assets at build time, the app doesn't need to perform compression during every request, which improves server performance.
- **Optimization**: Developers can focus on ensuring that assets are compressed to the smallest possible size during the build process.
For example, using **MapStaticAssets**, a file like `MudBlazor.min.css` is compressed down to 37.5 KB, whereas IIS dynamic compression might result in a size of 90 KB. This represents a **59%** reduction in size.
## About MapAbpStaticAssets
The ABP framework is 100% compatible with this new feature.
However, some JavaScript, CSS, and image files exist in the [Virtual File System](https://abp.io/docs/latest/framework/infrastructure/virtual-file-system), which ASP.NET Core's **MapStaticAssets** can't handle. For these files, additional **StaticFileMiddleware** is needed to serve them, which is where **MapAbpStaticAssets** comes in.
**MapAbpStaticAssets** adds the necessary **StaticFileMiddleware** to ensure that virtual files are correctly served. This middleware setup ensures seamless delivery of virtual resources alongside static assets.
You can view the source code of **MapAbpStaticAssets** on [GitHub](https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Builder/AbpApplicationBuilderExtensions.cs#L129-L198).
## Conclusion
Optimizing static asset delivery is essential for building fast, efficient web applications. **MapStaticAssets** simplifies and automates the optimization of static files by providing build-time compression, caching headers, and content-based ETags. This ensures that your app's static assets are always delivered in the most efficient way, whether users are on fast broadband or slower mobile connections. By using **MapStaticAssets**, you can deliver a faster, more reliable experience for your users with minimal effort.
## References
* [Static files in ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/static-files?view=aspnetcore-9.0)
* [What's new in ASP.NET Core 9.0](https://learn.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-9.0?view=aspnetcore-8.0#optimize-static-web-asset-delivery)

BIN
docs/en/Community-Articles/2024-11-13-BuiltIn-OpenApi-Documentation/cover.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 KiB

BIN
docs/en/Community-Articles/2024-11-13-BuiltIn-OpenApi-Documentation/img1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

BIN
docs/en/Community-Articles/2024-11-13-BuiltIn-OpenApi-Documentation/img2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

BIN
docs/en/Community-Articles/2024-11-13-BuiltIn-OpenApi-Documentation/img3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 KiB

BIN
docs/en/Community-Articles/2024-11-13-BuiltIn-OpenApi-Documentation/img4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

BIN
docs/en/Community-Articles/2024-11-13-BuiltIn-OpenApi-Documentation/img5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

164
docs/en/Community-Articles/2024-11-13-BuiltIn-OpenApi-Documentation/post.md

@ -0,0 +1,164 @@
Built-in OpenAPI Document Generation with .NET 9 — No more SwaggerUI! 👋
========================================================================
![Cover](cover.png)
What’s Swagger UI?
------------------
[Swagger UI](https://swagger.io/) is an open-source tool that automatically generates an interactive, web-based documentation interface for WebAPIs.
It supports OpenAPI standards. It was very popular tool among the ASP.NET Core developers from 2020 to 2024.
Because it was a built-in tool comes with ASP.NET Core default templates.
We liked this tool because it was the first tool that allows us to make WebAPI calls for testing.
Now it provides paid services as well as free ones.
> Previously, Swagger was included by default from **.NET 5** to **.NET 8** in .NET web templates.
---
What’s OpenAPI?
---------------
OpenAPI is a standard specification for defining REST APIs.
The official website is [https://www.openapis.org/](https://www.openapis.org/).
Microsoft is now using OpenAPI and here is the official documentation 👉 [https://aka.ms/aspnet/openapi](https://aka.ms/aspnet/openapi)
---
Replacement of Swagger UI with OpenAPI
----------------------------------------------------------------------------
Swagger UI is no longer integrated into NET 9, as Microsoft wants a solution with first-class support, better control, and enhanced security. As you see in the below screenshot, Microsoft declares that it's already removed.
![Docs](img2.png)
---
## Why is Swagger Removed from .NET 9?
In March 2024, the ASP.NET Core team announced that they are removing the `Swashbuckle.AspNetCore` dependency from web templates from .NET 9 release.
> This decision was influenced by the project's lack of active maintenance and the absence of an official release for .NET 8.
Microsoft team created a new package `Microsoft.AspNetCore.OpenApi`. It provides built-in OpenAPI document generation just like Swagger. So Microsoft doesn't depend on external tools. Because in every .NET release, they need to ask the owners of the external tool libraries to align with their new version. And sometimes these library owners cannot update their code-base according to the recent .NET changes. And it is becoming harder for Microsoft to support the 3rd party libraries under these circumstances. Basically reducing 3rd party dependencies will help Microsoft fast release cycles.
I read Reddit, GitHub discussions and YouTube reviews about this topic. As I see community members expressed concerns about the inactivity of Swashbuckle and they are discussing alternatives like contributing to or forking the project. The Microsoft team also contacted the owners of Swashbuckle and NSwag to explore potential collaborations and ensure a smooth transition for developers.
In the below GitHub issue, you can see the details of this decision:
* [github.com/dotnet/aspnetcore/issues/54599](https://github.com/dotnet/aspnetcore/issues/54599)
**Jeremy** -Product Manager- at Microsoft, answers why they took this decision in [this post](https://github.com/dotnet/aspnetcore/issues/54599#issuecomment-2004975574).
![Jeremy Comments](img3.png)
As a summary;
**The change is due to a lack of maintenance of the Swagger library**, although it has seen some recent updates. This aims to reduce dependency on external tools and provide a streamlined, out-of-the-box experience for generating OpenAPI documentation for ASP.NET Core Web APIs.
---
What are the Benefits of the New OpenAI Package?
---------------------------------------------------------------
### Native Support and Reduced Dependency
The new `Microsoft.AspNetCore.OpenApi` package provides first-class citizen support for OpenAPI. It reduces reliance on external tools like Swashbuckle or NSwag for basic documentation needs. The native implementation leverages source generators to reduce runtime overhead.
### Simplified Configuration
No need extra setup or 3rd party integrations. Just by defining controllers and endpoints, ASP.NET Core automatically generates OpenAPI specifications.
### Well Integration with Minimal APIs
[Minimal APIs](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis) introduced in .NET 6. There's an optimized built-in support for Minimal APIs. It automatically adds metadata for routes, request parameters, and responses.
### Compatibility with Existing Tools
You can still use the output of OpenAPI with Swagger or NSwag... So it doesn't mean that in this case you have only one option when you use OpenAPI.
---
How to Use the New OpenAPI in .NET9?
------------------------------------
When you create a new ASP.NET Core project, you can see the below checkbox to add OpenAPI.
![New .NET 9 Project Screen](img5.png)
I created a new .NET 9 web project, I saw that OpenAPI had already been added.
![Package Reference](img4.png)
## Add OpenAPI Support For Your Existing Project
Upgrade your project to .NET 9 and add the required NuGet package [Microsoft.AspNetCore.OpenApi](https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi)
```
dotnet add package Microsoft.AspNetCore.OpenApi
```
###
Add the following services and middleware in `Program.cs`
```
var builder = WebApplication.CreateBuilder();
builder.Services.AddOpenApi(); //<<-----
var app = builder.Build();
app.MapOpenApi(); //<<-----
app.MapGet("/", () => "Test");
app.Run();
```
Your OpenAPI document URL is [_https://localhost:7077/openapi/v1.json_](https://localhost:7077/openapi/v1.json)
Change the port to your active port. This is how it looks like:
![Web UI of the Documentation](img1.png)
---
Alternative 3rd Party Tool: Scalar
==================================
**Scalar** is an open-source API platform for RestAPI documentation. Also, it provides an interface for interacting with RESTful API. Generates interactive and user-friendly API documentation. Supports OpenAPI and Swagger specifications. It’s open-source with **7K stars** on GitHub.
See the repo 👉 [https://github.com/scalar/scalar](https://github.com/scalar/scalar).
That's all from the replacement of Swagger in .NET 9.
Happy coding 👨‍💻
**References**
* [https://learn.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-9.0?view=aspnetcore-8.0#openapi](https://learn.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-9.0?view=aspnetcore-8.0#openapi)

202
docs/en/Community-Articles/2024-11-14-Csharp-13-Features/Post.md

@ -0,0 +1,202 @@
# C# 13 Features
C# 13 is the latest version of C# and it comes with a lot of new features. In this article, we will discuss some of the new features of C# 13.
## `params` collections
With the C# 13, method parameter with `params` keyword isn't limited to be an array. You can now use any collection type that implements `IEnumerable<T>` interface.
Let's see how it can help us in our code.
```csharp
public IEnumerable<int> GetOdds(params IEnumerable<int> numbers)
{
foreach (var number in numbers)
{
if (number % 2 != 0)
{
Console.WriteLine(number);
}
}
}
```
## New lock object
I'm sure you have used `lock` statement in your code to synchronize access to a shared resource. With C# 13, you can now use a new lock object that is more efficient than the traditional lock object.
The new `Lock` type provides better thread synchronization through its API. When `Lock.EnterScope()` method is called, it returns a struct named `Scope` that contains a `Dispose` method. The `Dispose` method is called when the `Scope` object goes out of scope, which releases the lock. C# `using` statement recognizes the `Dispose` method and calls it automatically like it does with other `IDisposable` objects.
It was something similar before:
```csharp
private object _lock = new();
public void DoSomething()
{
lock (_lock)
{
// Do something
}
}
```
Now, you can use the new lock object like this:
```csharp
System.Threading.Lock x = new System.Threading.Lock();
public void DoSomething()
{
using (x.EnterScope())
{
// Do something
}
}
```
## New escape sequence
In C# 13, a new escape sequence `\e` has been introduced to represent the `ESCAPE` character, Unicode `U+001B`. Previously, you had to use `\u001b` or `\x1b` to represent this character. The new `\e` escape sequence simplifies this process and avoids potential issues with hexadecimal digits following `\x1b`.
> You can check [here](https://en.wikipedia.org/wiki/ANSI_escape_code#C0_control_codes) for ANSI escape codes.
## Implicit index access
The implicit "from the end" index operator, `^`, is now allowed in an object initializer expression.
It was not possible before, but now you can do this:
```csharp
var countdown = new TimerRemaining()
{
buffer =
{
[^1] = 0,
[^2] = 1,
[^3] = 2,
[^4] = 3,
[^5] = 4,
[^6] = 5,
[^7] = 6,
[^8] = 7,
[^9] = 8,
[^10] = 9
}
};
```
It's a great feature that makes the code more readable and maintainable. Still not a big deal, but it's nice to have it.
## `ref` and `unsafe` in iterators and async methods
In C# 13, the restrictions on using `ref` and `unsafe` constructs in iterators and async methods have been relaxed. Previously, you couldn't declare local `ref` variables or use unsafe contexts in these methods. Now, you can declare ref local variables and use unsafe contexts in async methods and iterators, provided they are not accessed across `await` or `yield` boundaries
This change allows for more expressive and efficient code, especially when working with types like `System.Span<T>` and `System.ReadOnlySpan<T>`. The compiler ensures that these constructs are used safely, and it will notify you if any safety rules are violated.
You can read more about this feature on the [Microsoft Learn page](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-13.0/ref-unsafe-in-iterators-async).
## More partial members
In C# 13, the concept of partial members has been expanded to include partial properties and partial indexers. Previously, only methods could be defined as partial members. This means you can now split the definition of properties and indexers across multiple files, just like you could with methods.
For example, you can declare a partial property in one part of your class and implement it in another part. Here's a simple illustration:
```csharp
public partial class MyClass
{
// Declaring declaration
public partial string MyProperty { get; set; }
}
public partial class MyClass
{
// Implementing declaration
private string _myProperty;
public partial string MyProperty
{
get => _myProperty;
set => _myProperty = value;
}
}
```
This feature allows for better organization and modularization of your code, especially in large projects where different parts of a class might be implemented by different team members.
## Overload resolution priority
What does "Overload resolution priority" section mean in this page?
In C# 13, the OverloadResolutionPriority attribute allows library authors to specify which method overload should be preferred by the compiler when multiple overloads are available. This attribute helps avoid ambiguity and ensures that the most appropriate overload is chosen, even if it might not be the most obvious choice based on traditional overload resolution rules.
This may be useful in scenarios where you have multiple overloads that are equally valid, but you want to prioritize one over the others. The attribute can be applied to a method or constructor to indicate its priority in the overload resolution process. It can prevent unexpected behavior and make your code more predictable and maintainable.
Let me show with an example:
```csharp
public class Example
{
// Existing method
public void Display(string message = "Hello!")
{
Console.WriteLine("Message: " + message);
}
// New, more efficient method with higher priority
[OverloadResolutionPriority(1)]
public void Display(string message = "Hello!", int repeatCount = 3)
{
for (int i = 0; i < repeatCount; i++)
{
Console.WriteLine("Message: " + message);
}
}
}
class Program
{
static void Main()
{
Example example = new Example();
// Normally, you can't compile this code because of ambiguity:
example.Display();
}
}
```
Output:
```
Message: Hello!
Message: Hello!
Message: Hello!
```
## The `field` keyword
n C# 13, the `field` keyword is introduced as a preview feature to simplify property accessors. This keyword allows you to reference the compiler-generated backing `field` directly within a property accessor, eliminating the need to declare an explicit backing `field` in your type declaration.
For example, instead of writing:
```csharp
private int _value;
public int Value
{
get => _value;
set => _value = value;
}
```
You can now write:
```csharp
public int Value
{
get => field;
set => field = value;
}
```
This makes your code cleaner and more concise. However, be cautious if you have a `field` named `field` in your class, as it could cause confusion. You can disambiguate by using `@field` or `this.field`.
Make sure you're using the latest `LangVersion` in your `.csproj` project file to enable this feature.
```xml
<LangVersion>preview</LangVersion>
```

165
docs/en/Community-Articles/2024-11-14-EF-Core-9-Linq-SQL-Translation/POST.md

@ -0,0 +1,165 @@
# EF Core 9 LINQ & SQL translation
EF Core improves the translation of LINQ queries to SQL with every release. EF Core 9 is no exception. This article will show you some of the improvements in EF Core 9.
EF Core 9 includes a lot of improvements in LINQ to SQL translation. we don't cover all of them in this article. You can find more information in the [official release notes](https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-9.0/whatsnew#linq-and-sql-translation).
## Support for complex types
### GroupBy
EF Core now supports grouping by complex type instance. For example:
```csharp
var groupedAddress = await context.Customers
.GroupBy(c => new { c.Address })
.Select(g => new { g.Key, Count = g.Count() })
.ToListAsync();
```
Address is a complex type as a value object here.
### ExecuteUpdate
EF Core now supports updating a complex type. For example:
```csharp
var newAddress = new Address("New Street", "New City", "New Country");
await context.Customers
.Where(e => e.Region == "Turkey")
.ExecuteUpdateAsync(s => s.SetProperty(b => b.Address, newAddress));
```
EF Core updates each column of the complex type.
## Prune unneeded elements from SQL
Ef Core now translates LINQ queries to SQL more efficiently. It will remove unneeded elements from the SQL query and bring better performance.
### Table pruning
When you use table-per-hierarchy (TPH) inheritance, previously EF Core generated SQL queries that included JIONs to tables that were not needed.
For example:
```csharp
public class Order
{
public int Id { get; set; }
...
public Customer Customer { get; set; }
}
public class DiscountedOrder : Order
{
public double Discount { get; set; }
}
public class Customer
{
public int Id { get; set; }
...
public List<Order> Orders { get; set; }
}
public class AppContext : DbContext
{
...
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Order>().UseTptMappingStrategy();
}
}
```
Consider the following query to get all customers with at least one order:
```csharp
var customers = await context.Customers.Where(o => o.Orders.Any()).ToListAsync();
```
Previously, EF Core generated the following SQL query:
```sql
SELECT [c].[Id], [c].[Name]
FROM [Customers] AS [c]
WHERE EXISTS (
SELECT 1
FROM [Orders] AS [o]
LEFT JOIN [DiscountedOrders] AS [d] ON [o].[Id] = [d].[Id]
WHERE [c].[Id] = [o].[CustomerId])
```
It included a JOIN to the `DiscountedOrders` table, which was not needed. In EF Core 9, the generated SQL query is:
```sql
SELECT [c].[Id], [c].[Name]
FROM [Customers] AS [c]
WHERE EXISTS (
SELECT 1
FROM [Orders] AS [o]
WHERE [c].[Id] = [o].[CustomerId])
```
## EF Core in ABP
ABP Framework is built on top of the latest technologies. It will support EF Core 9 as soon as it is released. You can use the latest features of EF Core in your ABP applications.
For example, you can use the `ExecuteUpdateAsync` method in your ABP application:
```csharp
public class Book : FullAuditedAggregateRoot<Guid>
{
public string Name { get; set; }
public float Price { get; set; }
public string Author { get; set; }
}
public class AppContext : AbpDbContext<AppContext>
{
public DbSet<Book> Books { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(builder);
builder.Entity<Book>(b =>
{
b.ToTable("Books");
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
b.Property(x => x.Author).IsRequired().HasMaxLength(64);
});
}
}
public class BookRepository : EfCoreRepository<AppContext, Book, Guid>, IBookRepository
{
public BookRepository(IDbContextProvider<AppContext> dbContextProvider)
: base(dbContextProvider)
{
}
public async Task UpdatePriceByAuthorAsync(string author, float price)
{
await (await GetDbSetAsync())
.Where(b => b.Author == author)
.ExecuteUpdateAsync(b => b.SetProperty(x => x.Price, price));
}
}
```
* `FullAuditedAggregateRoot` is an aggregate root base class with auditing properties provided by ABP Framework.
* `IRepository` is a generic repository interface provided by ABP Framework that provides CRUD operations and you can use EF Core's API in your entity repository implementation.
## References
* [LINQ and SQL translation](https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-9.0/whatsnew#linq-and-sql-translation)
* [ABP Entity Framework Core Integration](https://abp.io/docs/latest/framework/data/entity-framework-core)
* [ABP Entities](https://abp.io/docs/latest/framework/architecture/domain-driven-design/entities)

385
docs/en/Community-Articles/2024-12-01-OpenAI-Integration/POST.md

@ -0,0 +1,385 @@
# How to Use OpenAI API with ABP Framework
In this article, I will show you how to integrate and use the [OpenAI API](https://github.com/openai/openai-dotnet?tab=readme-ov-file#getting-started) with the [ABP Framework](https://abp.io/). We will explore step-by-step how these technologies can work together to enhance your application with powerful AI capabilities, such as natural language processing, image generation, and more.
![cover-image](cover-image.png)
## Creating an ABP Project
To begin integrating OpenAI API with ABP Framework, you first need to create an ABP project. Follow these steps to create and set up your ABP project:
### Step 1: Install ABP CLI
The ABP CLI is a command-line interface tool that helps you create and manage ABP projects easily. To install the ABP CLI, run the following command in your terminal:
```bash
dotnet tool install -g Volo.Abp.Studio.Cli
```
### Step 2: Create a New ABP Project
Once you have installed the ABP CLI, you can create a new ABP project using the following command:
```bash
abp new Acme.OpenAIIntegration -t app --ui-framework mvc --database-provider ef -dbms PostgreSQL --csf
```
> This command will generate a complete ABP project with an [MVC UI](https://abp.io/docs/latest/framework/ui/mvc-razor-pages/overall). The examples provided in this article make use of UI controllers for demonstration purposes. However, the same approach can easily be applied to other UI types supported by ABP, such as Blazor or Angular. You can find other options [here](https://abp.io/docs/latest/cli).
## OpenAI Integration Setup
To begin integrating OpenAI API with ABP Framework, follow these steps:
### Step 1: Create an API Key
To use the OpenAI services, you first need an API key. To obtain one, first [create a new OpenAI account](https://platform.openai.com/signup) or [log in](https://platform.openai.com/login). Next, navigate to the [API key page](https://platform.openai.com/account/api-keys) and select "Create new secret key", optionally naming the key. Make sure to save your API key somewhere safe and do not share it with anyone.
This key will be used to authenticate your application when making requests to the OpenAI endpoints.
### Step 2: Adding *Microsoft.Extensions.AI* Package
To integrate OpenAI API with ABP, we use [Microsoft.Extensions.AI](https://www.nuget.org/packages/Microsoft.Extensions.AI.OpenAI/). This package offers a unified API for integrating AI services, making it easy for developers to work with different AI providers. You can find more details in [this blog post](https://devblogs.microsoft.com/dotnet/introducing-microsoft-extensions-ai-preview/).
To begin integrating OpenAI API with ABP Framework, follow these steps:
1. Add the **Microsoft.Extensions.AI** and **Microsoft.Extensions.AI.OpenAI** (used to interact specifically with OpenAI services. Additionally, this package has alternatives like [Azure OpenAI](https://www.nuget.org/packages/Microsoft.Extensions.AI.OpenAI/), [Azure AI Inference](https://www.nuget.org/packages/Microsoft.Extensions.AI.AzureAIInference/), and [Ollama](https://www.nuget.org/packages/Microsoft.Extensions.AI.Ollama/), offering flexibility for developers to choose the AI provider that best fits their needs) packages:
```bash
dotnet add package Microsoft.Extensions.AI --prerelease
dotnet add package Microsoft.Extensions.AI.OpenAI --prerelease
```
2. Add the required configuration to the `appsettings.json` file located inside the `Acme.OpenAIIntegration.Web` project and dependencies to your `ConfigureServices` method:
```json
"AI": {
"OpenAI": {
"Key": "YOUR-API-KEY",
"Chat": {
"ModelId": "gpt-4o-mini"
}
}
}
```
> Replace the value of the `Key` with your OpenAI API key.
Next, add the following code to the `ConfigureServices` method in `OpenAIIntegrationBlazorModule`:
```csharp
context.Services.AddSingleton(new OpenAIClient(configuration["AI:OpenAI:Key"]));
context.Services.AddChatClient(services =>
services.GetRequiredService<OpenAIClient>().AsChatClient(configuration["AI:OpenAI:Chat:ModelId"] ?? "gpt-4o-mini"));
```
## Creating a Sample Page
To demonstrate the use of OpenAI API, let's create a page named `Sample` in the `Acme.OpenAIIntegration.Web` project:
Create a `Sample` folder under the `Pages` folder of the `Acme.OpenAIIntegration.Web` project. Add a new Razor Page by right-clicking the `Sample` folder then selecting `Add > Razor Page`. Name it `Index`.
Open the `Index.cshtml` and change the whole content as shown below:
> Note: This example demonstrates a simple implementation of a sample page that interacts with the OpenAI API, covering chat, [retrieval-augmented generation (RAG)](https://github.com/openai/openai-dotnet?tab=readme-ov-file#how-to-use-assistants-with-retrieval-augmented-generation-rag), and image generation features. Each example is explained in detail in the next section, so feel free to continue for a better understanding of the steps and logic involved.
```html
@page
@model Acme.OpenAIIntegration.Web.Pages.Sample
@{
ViewData["Title"] = "OpenAI API Demonstration";
}
<h1>@ViewData["Title"]</h1>
<br/><br/>
<div class="row">
<div class="col-md-4">
<h2>Chat Example</h2>
<form method="post" asp-page-handler="Chat">
<div class="form-group">
<label asp-for="ChatInput">Enter your message:</label>
<textarea asp-for="ChatInput" class="form-control" rows="4"></textarea>
</div>
<button type="submit" class="btn btn-primary mt-2">Send</button>
</form>
@if (!string.IsNullOrEmpty(Model.ChatResponse))
{
<h3 class="mt-3">Response:</h3>
<p>@Model.ChatResponse</p>
}
</div>
<div class="col-md-4">
<h2>RAG Example</h2>
<form method="post" asp-page-handler="RAG">
<div class="form-group mt-2">
<label asp-for="RAGQuery">Query:</label>
<input asp-for="RAGQuery" class="form-control" />
</div>
<button type="submit" class="btn btn-primary mt-2">Ask</button>
</form>
@if (!string.IsNullOrEmpty(Model.RAGResponse))
{
<h3 class="mt-3">Result:</h3>
<p>@Model.RAGResponse</p>
}
</div>
<div class="col-md-4">
<h2>Image Generation Example</h2>
<form method="post" asp-page-handler="ImageGeneration">
<div class="form-group">
<label asp-for="ImagePrompt">Image Description:</label>
<input asp-for="ImagePrompt" class="form-control" />
</div>
<button type="submit" class="btn btn-primary mt-2">Generate Image</button>
</form>
@if (Model.GeneratedImageBytes != null)
{
<h3 class="mt-3">Generated Image:</h3>
<img src="data:image/png;base64,@Convert.ToBase64String(Model.GeneratedImageBytes)" alt="Generated image" class="img-fluid mt-2" />
}
</div>
</div>
```
`Index.cshtml.cs` content should be like that:
```csharp
using System;
using System.ClientModel;
using System.IO;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.AI;
using OpenAI;
using OpenAI.Assistants;
using OpenAI.Files;
using OpenAI.Images;
namespace Acme.OpenAIIntegration.Web.Pages;
public class Sample : PageModel
{
[BindProperty]
public string ChatInput { get; set; }
public string ChatResponse { get; set; }
[BindProperty]
public string RAGQuery { get; set; }
public string RAGResponse { get; set; }
[BindProperty]
public string ImagePrompt { get; set; }
public byte[] GeneratedImageBytes { get; set; }
private readonly IChatClient _chatClient;
private readonly OpenAIClient _openAiClient;
public Sample(
IChatClient chatClient,
OpenAIClient openAiClient)
{
_chatClient = chatClient;
_openAiClient = openAiClient;
}
public async Task<IActionResult> OnPostChatAsync()
{
ChatResponse = $"Chat response: {(await _chatClient.CompleteAsync(ChatInput)).Message}";
return Page();
}
public async Task<IActionResult> OnPostRAGAsync()
{
#pragma warning disable OPENAI001
var fileClient = _openAiClient.GetOpenAIFileClient();
var assistantClient = _openAiClient.GetAssistantClient();
using var document = BinaryData.FromBytes(GetExceptionHandlingDocumentContent().ToArray()).ToStream();
var exceptionHandlingDoc = await fileClient.UploadFileAsync(
document,
"ExceptionHandling.md",
FileUploadPurpose.Assistants);
AssistantCreationOptions assistantOptions = new()
{
Name = "Exception Handling Assistant",
Instructions =
"""
This assistant helps you with exception handling in ABP Framework. You can ask questions about exception handling and get answers.
- Do not make any assumptions when asked for information that is not in the document
- Give the most accurate information possible
- Give short(max 1-2 sentence) and concise answers
- Do not provide file citations
""",
Tools =
{
new FileSearchToolDefinition(),
},
ToolResources = new()
{
FileSearch = new()
{
NewVectorStores =
{
new VectorStoreCreationHelper([exceptionHandlingDoc.Value.Id]),
}
}
},
};
var assistant = await assistantClient.CreateAssistantAsync("gpt-4o", assistantOptions);
ThreadCreationOptions threadOptions = new()
{
InitialMessages = { RAGQuery }
};
ThreadRun threadRun = assistantClient.CreateThreadAndRun(assistant.Value.Id, threadOptions);
do
{
Thread.Sleep(TimeSpan.FromSeconds(1));
threadRun = assistantClient.GetRun(threadRun.ThreadId, threadRun.Id);
} while (!threadRun.Status.IsTerminal);
CollectionResult<ThreadMessage> messages
= assistantClient.GetMessages(threadRun.ThreadId,
new MessageCollectionOptions() { Order = MessageCollectionOrder.Ascending });
var response = new StringBuilder();
foreach (var message in messages)
{
response.AppendLine($"[{message.Role.ToString().ToUpper()}]: ");
foreach (var contentItem in message.Content)
{
if (!string.IsNullOrEmpty(contentItem.Text))
{
response.AppendLine(contentItem.Text);
if (contentItem.TextAnnotations.Count > 0)
{
response.AppendLine("");
}
}
}
response.AppendLine("");
#pragma warning restore OPENAI001
}
RAGResponse = response.ToString();
return Page();
}
public async Task<IActionResult> OnPostImageGenerationAsync()
{
var client = _openAiClient.GetImageClient("dall-e-3");
var image = await client.GenerateImageAsync(ImagePrompt, new ImageGenerationOptions
{
ResponseFormat = GeneratedImageFormat.Bytes
});
var imageBytes = image.Value.ImageBytes;
using var memoryStream = new MemoryStream();
await imageBytes.ToStream().CopyToAsync(memoryStream);
GeneratedImageBytes = memoryStream.ToArray();
return Page();
}
public ReadOnlySpan<byte> GetExceptionHandlingDocumentContent()
{
return """
# Exception Handling
ABP provides a built-in infrastructure and offers a standard model for handling exceptions.
* Automatically **handles all exceptions** and sends a standard **formatted error message** to the client for an API/AJAX request.
* Automatically hides **internal infrastructure errors** and returns a standard error message.
* Provides an easy and configurable way to **localize** exception messages.
* Automatically maps standard exceptions to **HTTP status codes** and provides a configurable option to map custom exceptions.
## Automatic Exception Handling
`AbpExceptionFilter` handles an exception if **any of the following conditions** are met:
* Exception is thrown by a **controller action** which returns an **object result** (not a view result).
* The request is an AJAX request (`X-Requested-With` HTTP header value is `XMLHttpRequest`).
* Client explicitly accepts the `application/json` content type (via `accept` HTTP header).
If the exception is handled it's automatically **logged** and a formatted **JSON message** is returned to the client.
## Business Exceptions
Most of your own exceptions will be business exceptions. The `IBusinessException` interface is used to mark an exception as a business exception.
`BusinessException` implements the `IBusinessException` interface in addition to the `IHasErrorCode`, `IHasErrorDetails` and `IHasLogLevel` interfaces. The default log level is `Warning`.
Usually you have an error code related to a particular business exception. For example:
````C#
throw new BusinessException(QaErrorCodes.CanNotVoteYourOwnAnswer);
````
### User Friendly Exception
If an exception implements the `IUserFriendlyException` interface, then ABP does not change it's `Message` and `Details` properties and directly send it to the client.
`UserFriendlyException` class is the built-in implementation of the `IUserFriendlyException` interface. Example usage:
````C#
throw new UserFriendlyException(
"Username should be unique!"
);
````
* The `IUserFriendlyException` interface is derived from the `IBusinessException` and the `UserFriendlyException` class is derived from the `BusinessException` class.
"""u8;
}
}
```
## Running the Application
After completing the setup, you can run the application using the following command:
```bash
dotnet run --project ./src/Acme.OpenAIIntegration.Web
```
Once the application is running, open your browser and navigate to `/Sample`. You should see the `Sample` page we created, which contains sections for Chat, RAG (Retrieval-Augmented Generation), and Image Generation. You can find the screenshot of the page below:
![sample page](sample-page.png)
## Examples Overview
To showcase the integration of the OpenAI API with the ABP Framework, we implemented three different examples:
1. **Chat Example**: This example demonstrates how to use OpenAI's chat capabilities by allowing users to enter a message and receive an AI-generated response. The implementation involves setting up a simple form on the `Sample` page where users can input their message. The form submission triggers the `OnPostChatAsync` method, which uses the `IChatClient` to generate a response.
![chat-example](chat-example.gif)
2. **Retrieval-Augmented Generation (RAG) Example**: In this example, we use OpenAI to answer user queries by referencing custom documents uploaded to the OpenAI API. The implementation involves uploading a document using the `OpenAIFileClient` and creating an assistant with specific instructions to handle the uploaded content. In this case, the document is a section from ABP's Exception Handling documentation, which includes examples on how ABP handles exceptions, user-friendly error messages, and business exceptions. Users can input their query on the `Sample` page, and the `OnPostRAGAsync` method processes the query to generate precise answers based on the document content. If users ask questions that are not covered in the document, the assistant clearly indicates that the information is not available, as per the instructions provided. For example, when asked about `Object Extensions`, the response begins with: "The uploaded document does not contain information about `Object Extensions`...". This demonstrates how the assistant adheres to the provided instructions. You can also find this example illustrated in the GIF below.
![rag-example-1](rag-example-1.gif)
![rag-example-2](rag-example-2.gif)
3. **Image Generation Example**: This example leverages the [DALL-E](https://openai.com/index/dall-e-3/) model to generate images based on user-provided prompts. On the `Sample` page, users can provide a description of the image they want to generate, and the `OnPostImageGenerationAsync` method uses the `OpenAIClient` to generate the image.
![image-generation-example](image-generation-example.gif)
## Conclusion
In this article, we covered how to integrate the OpenAI API with the ABP Framework by creating a sample project, setting up the OpenAI services, and implementing examples for conversational AI, knowledge-based assistance, and image generation. By following these steps, you can add powerful AI-driven capabilities to your application, making it more interactive, intelligent, and capable of meeting user needs effectively.

BIN
docs/en/Community-Articles/2024-12-01-OpenAI-Integration/chat-example.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

BIN
docs/en/Community-Articles/2024-12-01-OpenAI-Integration/cover-image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 565 KiB

BIN
docs/en/Community-Articles/2024-12-01-OpenAI-Integration/image-generation-example.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 954 KiB

BIN
docs/en/Community-Articles/2024-12-01-OpenAI-Integration/rag-example-1.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

BIN
docs/en/Community-Articles/2024-12-01-OpenAI-Integration/rag-example-2.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

BIN
docs/en/Community-Articles/2024-12-01-OpenAI-Integration/sample-page.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

2
docs/en/cli/index.md

@ -915,7 +915,7 @@ abp logout
### bundle
This command generates script and style references for ABP Blazor WebAssembly and MAUI Blazor project and updates the **index.html** file. It helps developers to manage dependencies required by ABP modules easily. In order ```bundle``` command to work, its **executing directory** or passed ```--working-directory``` parameter's directory must contain a Blazor or MAUI Blazor project file(*.csproj).
This command generates script and style references for ABP Blazor WebAssembly and MAUI Blazor project and updates the **index.html** file. It helps developers to manage dependencies required by ABP modules easily. In order for ```bundle``` command to work, its **executing directory** or passed ```--working-directory``` parameter's directory must contain a Blazor or MAUI Blazor project file(*.csproj).
Usage:

6
docs/en/framework/architecture/domain-driven-design/specifications.md

@ -81,7 +81,7 @@ namespace MyProject
{
public class CustomerService : ITransientDependency
{
public async Task BuyAlcohol(Customer customer)
public async Task BookRoom(Customer customer)
{
if (!new Age18PlusCustomerSpecification().IsSatisfiedBy(customer))
{
@ -120,7 +120,7 @@ namespace MyProject
_customerRepository = customerRepository;
}
public async Task<List<Customer>> GetCustomersCanBuyAlcohol()
public async Task<List<Customer>> GetCustomersCanBookRoom()
{
var queryable = await _customerRepository.GetQueryableAsync();
var query = queryable.Where(
@ -254,4 +254,4 @@ Some benefits of using specifications:
### When To Not Use?
- **Non business expressions**: Do not use specifications for non business-related expressions and operations.
- **Reporting**: If you are just creating a report, do not create specifications, but directly use `IQueryable` & LINQ expressions. You can even use plain SQL, views or another tool for reporting. DDD does not necessarily care about reporting, so the way you query the underlying data store can be important from a performance perspective.
- **Reporting**: If you are just creating a report, do not create specifications, but directly use `IQueryable` & LINQ expressions. You can even use plain SQL, views or another tool for reporting. DDD does not necessarily care about reporting, so the way you query the underlying data store can be important from a performance perspective.

2
docs/en/get-started/index.md

@ -5,7 +5,7 @@ Great that you've decided to create a new application with ABP. ABP provides mul
Please select one of the following documents best fits for your application:
- **[Single-Layer Solution](single-layer-web-application.md)**: Creates a single-project solution. Recommended for building an application with a **simpler and easy to understand** architecture.
- **[Layered Solution](layered-web-application.md)**: A fully layered (multiple projects) solution based on [Domain Driven Design](../framework/architecture/domain-driven-design) practices. Recommended for long-term projects that need a **maintainable and extensible** codebase.
- **[Application (Layered)](layered-web-application.md)**: A fully layered (multiple projects) solution based on [Domain Driven Design](../framework/architecture/domain-driven-design) practices. Recommended for long-term projects that need a **maintainable and extensible** codebase.
- **[Microservice Solution](microservice.md)**: A **distributed solution** to build **microservice systems**. It includes pre-built services, API gateways, web and mobile applications, Kubernetes and Helm configuration, and everything you need to start your large-scale microservice solution.
- **Others**
- [Empty ASP.NET Core Application](empty-aspnet-core-application.md)

BIN
docs/en/images/idle-message.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

BIN
docs/en/images/idle-setting.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 KiB

1
docs/en/modules/account-pro.md

@ -358,3 +358,4 @@ This module doesn't define any additional distributed event. See the [standard d
* [Impersonation](./account/impersonation.md)
* [Linked Accounts](./account/linkedaccounts.md)
* [Session Management](./account/session-management.md)
* [Idle Session Timeout](./account/idle-session-timeout.md)]

19
docs/en/modules/account/idle-session-timeout.md

@ -0,0 +1,19 @@
# Idle Session Timeout
The `Idle Session Timeout` feature allows you to automatically log out users after a certain period of inactivity.
## Configure Idle Session Timeout
You can enable/disable the `Idle Session Timeout` feature in the `Setting > Account > Idle Session Timeout` page.
The default idle session timeout is 1 hour. You can change it by selecting a different value from the dropdown list or entering a custom value(in minutes).
![idle-setting](../../images/idle-setting.png)
Once the idle session timeout is reached, the user will see a warning modal before being logged out. if user does not respond for 60 seconds, the user will be logged out automatically.
![idle-setting](../../images/idle-message.png)
## How it works
There is JavaScript code running in the background to detect user activity. such as mouse movement, key press, click, etc. If there is no activity detected for setting time, The warning modal will be shown to the user.

2
docs/en/modules/openiddict.md

@ -279,7 +279,7 @@ UserInfoController -> connect/userinfo
> **Device flow** implementation will be done in the commercial module.
#### AbpOpenIddictAspNetCoreOptions
### AbpOpenIddictAspNetCoreOptions
`AbpOpenIddictAspNetCoreOptions` can be configured in the `PreConfigureServices` method of your OpenIddict [module](../framework/architecture/modularity/basics.md).

2
docs/en/suite/generating-crud-page.md

@ -273,7 +273,7 @@ Alternatively, you can add `IdentityUser` entity (or any other entity) as a navi
### New book dialog
###### ![New book dialog](../images/suite-ui-new-book.png)
### ![New book dialog](../images/suite-ui-new-book.png)
### Book list page

296
framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/DaprAspNetCore/AbpDaprEndpointRouteBuilderExtensions.cs

@ -1,296 +0,0 @@
// ------------------------------------------------------------------------
// Copyright 2021 The Dapr Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Dapr
{
/// <summary>
/// This class defines configurations for the subscribe endpoint.
/// </summary>
public class AbpSubscribeOptions
{
/// <summary>
/// Gets or Sets a value which indicates whether to enable or disable processing raw messages.
/// </summary>
public bool EnableRawPayload { get; set; }
/// <summary>
/// An optional delegate used to configure the subscriptions.
/// </summary>
public Func<List<AbpSubscription>, Task>? SubscriptionsCallback { get; set; }
}
/// <summary>
/// This class defines subscribe endpoint response
/// </summary>
public class AbpSubscription
{
/// <summary>
/// Gets or sets the topic name.
/// </summary>
public string Topic { get; set; } = default!;
/// <summary>
/// Gets or sets the pubsub name
/// </summary>
public string PubsubName { get; set; } = default!;
/// <summary>
/// Gets or sets the route
/// </summary>
public string? Route { get; set; }
/// <summary>
/// Gets or sets the routes
/// </summary>
public AbpRoutes? Routes { get; set; }
/// <summary>
/// Gets or sets the metadata.
/// </summary>
public AbpMetadata? Metadata { get; set; }
/// <summary>
/// Gets or sets the deadletter topic.
/// </summary>
public string? DeadLetterTopic { get; set; }
}
/// <summary>
/// This class defines the metadata for subscribe endpoint.
/// </summary>
public class AbpMetadata : Dictionary<string, string>
{
/// <summary>
/// Initializes a new instance of the Metadata class.
/// </summary>
public AbpMetadata() { }
/// <summary>
/// Initializes a new instance of the Metadata class.
/// </summary>
/// <param name="dictionary"></param>
public AbpMetadata(IDictionary<string, string> dictionary) : base(dictionary) { }
/// <summary>
/// RawPayload key
/// </summary>
internal const string RawPayload = "rawPayload";
}
/// <summary>
/// This class defines the routes for subscribe endpoint.
/// </summary>
public class AbpRoutes
{
/// <summary>
/// Gets or sets the default route
/// </summary>
public string? Default { get; set; }
/// <summary>
/// Gets or sets the routing rules
/// </summary>
public List<AbpRule>? Rules { get; set; }
}
/// <summary>
/// This class defines the rule for subscribe endpoint.
/// </summary>
public class AbpRule
{
/// <summary>
/// Gets or sets the CEL expression to match this route.
/// </summary>
public string Match { get; set; } = default!;
/// <summary>
/// Gets or sets the path of the route.
/// </summary>
public string Path { get; set; } = default!;
}
}
namespace Microsoft.AspNetCore.Builder
{
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using System.Text.Json.Serialization;
using Dapr;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.Routing.Patterns;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
/// <summary>
/// Contains extension methods for <see cref="IEndpointRouteBuilder" />.
/// </summary>
public static class AbpDaprEndpointRouteBuilderExtensions
{
/// <summary>
/// Maps an endpoint that will respond to requests to <c>/dapr/subscribe</c> from the
/// Dapr runtime.
/// </summary>
/// <param name="endpoints">The <see cref="IEndpointRouteBuilder" />.</param>
/// <returns>The <see cref="IEndpointConventionBuilder" />.</returns>
public static IEndpointConventionBuilder MapAbpSubscribeHandler(this IEndpointRouteBuilder endpoints)
{
return CreateSubscribeEndPoint(endpoints);
}
/// <summary>
/// Maps an endpoint that will respond to requests to <c>/dapr/subscribe</c> from the
/// Dapr runtime.
/// </summary>
/// <param name="endpoints">The <see cref="IEndpointRouteBuilder" />.</param>
/// <param name="options">Configuration options</param>
/// <returns>The <see cref="IEndpointConventionBuilder" />.</returns>
/// <seealso cref="MapAbpSubscribeHandler(IEndpointRouteBuilder)"/>
public static IEndpointConventionBuilder MapAbpSubscribeHandler(this IEndpointRouteBuilder endpoints, AbpSubscribeOptions options)
{
return CreateSubscribeEndPoint(endpoints, options);
}
private static IEndpointConventionBuilder CreateSubscribeEndPoint(IEndpointRouteBuilder endpoints, AbpSubscribeOptions? options = null)
{
if (endpoints is null)
{
throw new System.ArgumentNullException(nameof(endpoints));
}
return endpoints.MapGet("dapr/subscribe", async context =>
{
var logger = context.RequestServices.GetService<ILoggerFactory>()?.CreateLogger("DaprTopicSubscription");
var dataSource = context.RequestServices.GetRequiredService<EndpointDataSource>();
var subscriptions = dataSource.Endpoints
.OfType<RouteEndpoint>()
.Where(e => e.Metadata.GetOrderedMetadata<ITopicMetadata>().Any(t => t.Name != null)) // only endpoints which have TopicAttribute with not null Name.
.SelectMany(e =>
{
var topicMetadata = e.Metadata.GetOrderedMetadata<ITopicMetadata>();
var originalTopicMetadata = e.Metadata.GetOrderedMetadata<IOriginalTopicMetadata>();
var subs = new List<(string PubsubName, string Name, string? DeadLetterTopic, bool? EnableRawPayload, string Match, int Priority, Dictionary<string, string[]> OriginalTopicMetadata, string? MetadataSeparator, RoutePattern RoutePattern)>();
for (int i = 0; i < topicMetadata.Count(); i++)
{
subs.Add((topicMetadata[i].PubsubName,
topicMetadata[i].Name,
(topicMetadata[i] as IDeadLetterTopicMetadata)?.DeadLetterTopic,
(topicMetadata[i] as IRawTopicMetadata)?.EnableRawPayload,
topicMetadata[i].Match,
topicMetadata[i].Priority,
originalTopicMetadata.Where(m => (topicMetadata[i] as IOwnedOriginalTopicMetadata)?.OwnedMetadatas?.Any(o => o.Equals(m.Id)) == true || string.IsNullOrEmpty(m.Id))
.GroupBy(c => c.Name)
.ToDictionary(m => m.Key, m => m.Select(c => c.Value).Distinct().ToArray()),
(topicMetadata[i] as IOwnedOriginalTopicMetadata)?.MetadataSeparator,
e.RoutePattern));
}
return subs;
})
.Distinct()
.GroupBy(e => new { e.PubsubName, e.Name })
.Select(e => e.OrderBy(e => e.Priority))
.Select(e =>
{
var first = e.First();
var rawPayload = e.Any(e => e.EnableRawPayload.GetValueOrDefault());
var metadataSeparator = e.FirstOrDefault(e => !string.IsNullOrEmpty(e.MetadataSeparator)).MetadataSeparator?.ToString() ?? ",";
var rules = e.Where(e => !string.IsNullOrEmpty(e.Match)).ToList();
var defaultRoutes = e.Where(e => string.IsNullOrEmpty(e.Match)).Select(e => RoutePatternToString(e.RoutePattern)).ToList();
var defaultRoute = defaultRoutes.FirstOrDefault();
//multiple identical names. use comma separation.
var metadata = new AbpMetadata(e.SelectMany(c => c.OriginalTopicMetadata).GroupBy(c => c.Key).ToDictionary(c => c.Key, c => string.Join(metadataSeparator, c.SelectMany(c => c.Value).Distinct())));
if (rawPayload || options?.EnableRawPayload is true)
{
metadata.Add(AbpMetadata.RawPayload, "true");
}
if (logger != null)
{
if (defaultRoutes.Count > 1)
{
logger.LogError("A default subscription to topic {name} on pubsub {pubsub} already exists.", first.Name, first.PubsubName);
}
var duplicatePriorities = rules.GroupBy(e => e.Priority)
.Where(g => g.Count() > 1)
.ToDictionary(x => x.Key, y => y.Count());
foreach (var entry in duplicatePriorities)
{
logger.LogError("A subscription to topic {name} on pubsub {pubsub} has duplicate priorities for {priority}: found {count} occurrences.", first.Name, first.PubsubName, entry.Key, entry.Value);
}
}
var subscription = new AbpSubscription
{
Topic = first.Name,
PubsubName = first.PubsubName,
Metadata = metadata.Count > 0 ? metadata : null,
};
if (first.DeadLetterTopic != null)
{
subscription.DeadLetterTopic = first.DeadLetterTopic;
}
// Use the V2 routing rules structure
if (rules.Count > 0)
{
subscription.Routes = new AbpRoutes
{
Rules = rules.Select(e => new AbpRule
{
Match = e.Match,
Path = RoutePatternToString(e.RoutePattern),
}).ToList(),
Default = defaultRoute,
};
}
// Use the V1 structure for backward compatibility.
else
{
subscription.Route = defaultRoute;
}
return subscription;
})
.OrderBy(e => (e.PubsubName, e.Topic))
.ToList();
await options?.SubscriptionsCallback!(subscriptions)!;
await context.Response.WriteAsync(JsonSerializer.Serialize(subscriptions,
new JsonSerializerOptions
{
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
}));
});
}
private static string RoutePatternToString(RoutePattern routePattern)
{
return string.Join("/", routePattern.PathSegments
.Select(segment => string.Concat(segment.Parts.Cast<RoutePatternLiteralPart>()
.Select(part => part.Content))));
}
}
}

135
framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/AbpAspNetCoreMvcDaprEventBusModule.cs

@ -1,11 +1,16 @@
using System.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using System.Threading.Tasks;
using Dapr;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Dapr;
using Volo.Abp.EventBus;
using Volo.Abp.EventBus.Dapr;
using Volo.Abp.EventBus.Distributed;
@ -21,50 +26,98 @@ public class AbpAspNetCoreMvcDaprEventBusModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var subscribeOptions = context.Services.ExecutePreConfiguredActions<AbpSubscribeOptions>();
Configure<AbpEndpointRouterOptions>(options =>
PostConfigure<AbpEndpointRouterOptions>(options =>
{
options.EndpointConfigureActions.Add(endpointContext =>
{
var rootServiceProvider = endpointContext.ScopeServiceProvider.GetRequiredService<IRootServiceProvider>();
subscribeOptions.SubscriptionsCallback = subscriptions =>
{
var daprEventBusOptions = rootServiceProvider.GetRequiredService<IOptions<AbpDaprEventBusOptions>>().Value;
foreach (var handler in rootServiceProvider.GetRequiredService<IOptions<AbpDistributedEventBusOptions>>().Value.Handlers)
var topicMetadatas = endpointContext.Endpoints.DataSources.SelectMany(x => x.Endpoints).OfType<RouteEndpoint>()
.Where(e => e.Metadata.GetOrderedMetadata<ITopicMetadata>().Any(t => t.Name != null))
.SelectMany(e => e.Metadata.GetOrderedMetadata<ITopicMetadata>())
.ToList();
var endpointConventionBuilder = endpointContext.Endpoints.MapPost(
"/api/abp/dapr/event", async httpContext =>
{
foreach (var @interface in handler.GetInterfaces().Where(x => x.IsGenericType && x.GetGenericTypeDefinition() == typeof(IDistributedEventHandler<>)))
{
var eventType = @interface.GetGenericArguments()[0];
var eventName = EventNameAttribute.GetNameOrDefault(eventType);
if (subscriptions.Any(x => x.PubsubName == daprEventBusOptions.PubSubName && x.Topic == eventName))
{
// Controllers with a [Topic] attribute can replace built-in event handlers.
continue;
}
var subscription = new AbpSubscription
{
PubsubName = daprEventBusOptions.PubSubName,
Topic = eventName,
Route = AbpAspNetCoreMvcDaprPubSubConsts.DaprEventCallbackUrl,
Metadata = new AbpMetadata
{
{
AbpMetadata.RawPayload, "true"
}
}
};
subscriptions.Add(subscription);
}
}
return Task.CompletedTask;
};
endpointContext.Endpoints.MapAbpSubscribeHandler(subscribeOptions);
await HandleEventAsync(httpContext);
});
var abpEvents = GetAbpEvents(endpointContext);
foreach (var @event in abpEvents.Where(x => !topicMetadatas.Any(t => t.PubsubName == x.PubsubName && t.Name == x.Name)))
{
endpointConventionBuilder.WithMetadata(new TopicAttribute(
@event.PubsubName,
@event.Name,
true));
}
endpointContext.Endpoints.MapSubscribeHandler();
});
});
}
private List<TopicAttribute> GetAbpEvents(EndpointRouteBuilderContext endpointContext)
{
var subscriptions = new List<TopicAttribute>();
var daprEventBusOptions = endpointContext.Endpoints.ServiceProvider.GetRequiredService<IOptions<AbpDaprEventBusOptions>>().Value;
foreach (var @interface in endpointContext.Endpoints.ServiceProvider.GetRequiredService<IOptions<AbpDistributedEventBusOptions>>().Value.Handlers
.SelectMany(x => x.GetInterfaces().Where(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IDistributedEventHandler<>))))
{
var eventType = @interface.GetGenericArguments()[0];
var eventName = EventNameAttribute.GetNameOrDefault(eventType);
var subscription = new TopicAttribute(daprEventBusOptions.PubSubName, eventName);
subscriptions.Add(subscription);
}
return subscriptions;
}
private async static Task HandleEventAsync(HttpContext httpContext)
{
var logger = httpContext.RequestServices.GetRequiredService<ILogger<AbpAspNetCoreMvcDaprEventBusModule>>();
httpContext.ValidateDaprAppApiToken();
var daprSerializer = httpContext.RequestServices.GetRequiredService<IDaprSerializer>();
var body = (await JsonDocument.ParseAsync(httpContext.Request.Body));
var pubSubName = body.RootElement.GetProperty("pubsubname").GetString();
var topic = body.RootElement.GetProperty("topic").GetString();
var data = body.RootElement.GetProperty("data").GetRawText();
if (pubSubName.IsNullOrWhiteSpace() || topic.IsNullOrWhiteSpace() || data.IsNullOrWhiteSpace())
{
logger.LogError("Invalid Dapr event request.");
httpContext.Response.StatusCode = 400;
return;
}
var distributedEventBus = httpContext.RequestServices.GetRequiredService<DaprDistributedEventBus>();
if (IsAbpDaprEventData(data))
{
var daprEventData = daprSerializer.Deserialize(data, typeof(AbpDaprEventData)).As<AbpDaprEventData>();
var eventData = daprSerializer.Deserialize(daprEventData.JsonData, distributedEventBus.GetEventType(daprEventData.Topic));
await distributedEventBus.TriggerHandlersAsync(distributedEventBus.GetEventType(daprEventData.Topic), eventData, daprEventData.MessageId, daprEventData.CorrelationId);
}
else
{
var eventData = daprSerializer.Deserialize(data, distributedEventBus.GetEventType(topic!));
await distributedEventBus.TriggerHandlersAsync(distributedEventBus.GetEventType(topic!), eventData);
}
httpContext.Response.StatusCode = 200;
}
private static bool IsAbpDaprEventData(string data)
{
var document = JsonDocument.Parse(data);
var objects = document.RootElement.EnumerateObject().ToList();
return objects.Count == 5 &&
objects.Any(x => x.Name.Equals("PubSubName", StringComparison.CurrentCultureIgnoreCase)) &&
objects.Any(x => x.Name.Equals("Topic", StringComparison.CurrentCultureIgnoreCase)) &&
objects.Any(x => x.Name.Equals("MessageId", StringComparison.CurrentCultureIgnoreCase)) &&
objects.Any(x => x.Name.Equals("JsonData", StringComparison.CurrentCultureIgnoreCase)) &&
objects.Any(x => x.Name.Equals("CorrelationId", StringComparison.CurrentCultureIgnoreCase));
}
}

6
framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/AbpAspNetCoreMvcDaprPubSubConsts.cs

@ -1,6 +0,0 @@
namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus;
public class AbpAspNetCoreMvcDaprPubSubConsts
{
public const string DaprEventCallbackUrl = "api/abp/dapr/event";
}

62
framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/Controllers/AbpAspNetCoreMvcDaprEventsController.cs

@ -1,62 +0,0 @@
using System;
using System.Linq;
using System.Text.Json;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Volo.Abp.Dapr;
using Volo.Abp.EventBus.Dapr;
namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.Controllers;
[Area("abp")]
[RemoteService(Name = "abp")]
public class AbpAspNetCoreMvcDaprEventsController : AbpController
{
[HttpPost(AbpAspNetCoreMvcDaprPubSubConsts.DaprEventCallbackUrl)]
public virtual async Task<IActionResult> EventAsync()
{
HttpContext.ValidateDaprAppApiToken();
var daprSerializer = HttpContext.RequestServices.GetRequiredService<IDaprSerializer>();
var body = (await JsonDocument.ParseAsync(HttpContext.Request.Body));
var pubSubName = body.RootElement.GetProperty("pubsubname").GetString();
var topic = body.RootElement.GetProperty("topic").GetString();
var data = body.RootElement.GetProperty("data").GetRawText();
if (pubSubName.IsNullOrWhiteSpace() || topic.IsNullOrWhiteSpace() || data.IsNullOrWhiteSpace())
{
Logger.LogError("Invalid Dapr event request.");
return BadRequest();
}
var distributedEventBus = HttpContext.RequestServices.GetRequiredService<DaprDistributedEventBus>();
if (IsAbpDaprEventData(data))
{
var daprEventData = daprSerializer.Deserialize(data, typeof(AbpDaprEventData)).As<AbpDaprEventData>();
var eventData = daprSerializer.Deserialize(daprEventData.JsonData, distributedEventBus.GetEventType(daprEventData.Topic));
await distributedEventBus.TriggerHandlersAsync(distributedEventBus.GetEventType(daprEventData.Topic), eventData, daprEventData.MessageId, daprEventData.CorrelationId);
}
else
{
var eventData = daprSerializer.Deserialize(data, distributedEventBus.GetEventType(topic!));
await distributedEventBus.TriggerHandlersAsync(distributedEventBus.GetEventType(topic!), eventData);
}
return Ok();
}
protected virtual bool IsAbpDaprEventData(string data)
{
var document = JsonDocument.Parse(data);
var objects = document.RootElement.EnumerateObject().ToList();
return objects.Count == 5 &&
objects.Any(x => x.Name.Equals("PubSubName", StringComparison.CurrentCultureIgnoreCase)) &&
objects.Any(x => x.Name.Equals("Topic", StringComparison.CurrentCultureIgnoreCase)) &&
objects.Any(x => x.Name.Equals("MessageId", StringComparison.CurrentCultureIgnoreCase)) &&
objects.Any(x => x.Name.Equals("JsonData", StringComparison.CurrentCultureIgnoreCase)) &&
objects.Any(x => x.Name.Equals("CorrelationId", StringComparison.CurrentCultureIgnoreCase));
}
}

3
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/ConventionalRouteBuilder.cs

@ -2,6 +2,7 @@
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using Microsoft.AspNetCore.Mvc.ApplicationModels;
using Microsoft.Extensions.Options;
using Volo.Abp.DependencyInjection;
@ -63,7 +64,7 @@ public class ConventionalRouteBuilder : IConventionalRouteBuilder, ITransientDep
//Add secondary Id
var secondaryIds = action.Parameters
.Where(p => p.ParameterName.EndsWith("Id", StringComparison.Ordinal)).ToList();
if (secondaryIds.Count == 1)
if (secondaryIds.Count == 1 && !secondaryIds[0].Attributes.Any(x => x is OptionalAttribute))
{
url += $"/{{{NormalizeSecondaryIdNameCase(secondaryIds[0], configuration)}}}";
}

3
framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor

@ -17,7 +17,8 @@
Disabled=@Disabled>
@if(!string.IsNullOrEmpty(Icon))
{
<Icon Name="@Icon" Class="me-1"/>
var iconClass = Text.IsNullOrEmpty() ? "" : "me-1";
<Icon Name="@Icon" Class="@iconClass"/>
}
<Span>
@Text

3
framework/src/Volo.Abp.Core/Volo.Abp.Core.csproj

@ -33,6 +33,9 @@
<PackageReference Include="JetBrains.Annotations" />
<PackageReference Include="Nito.AsyncEx.Context" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="System.Threading.Tasks.Extensions" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFrameworkIdentifier)' == '.NETStandard' And $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '2.1')) ">
<PackageReference Include="System.ComponentModel.Annotations" />
</ItemGroup>

26
framework/src/Volo.Abp.Core/Volo/Abp/Threading/SemaphoreSlimExtensions.cs

@ -1,4 +1,5 @@
using System;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
@ -6,19 +7,22 @@ namespace Volo.Abp.Threading;
public static class SemaphoreSlimExtensions
{
public async static Task<IDisposable> LockAsync(this SemaphoreSlim semaphoreSlim)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public async static ValueTask<IDisposable> LockAsync(this SemaphoreSlim semaphoreSlim)
{
await semaphoreSlim.WaitAsync();
return GetDispose(semaphoreSlim);
}
public async static Task<IDisposable> LockAsync(this SemaphoreSlim semaphoreSlim, CancellationToken cancellationToken)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public async static ValueTask<IDisposable> LockAsync(this SemaphoreSlim semaphoreSlim, CancellationToken cancellationToken)
{
await semaphoreSlim.WaitAsync(cancellationToken);
return GetDispose(semaphoreSlim);
}
public async static Task<IDisposable> LockAsync(this SemaphoreSlim semaphoreSlim, int millisecondsTimeout)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public async static ValueTask<IDisposable> LockAsync(this SemaphoreSlim semaphoreSlim, int millisecondsTimeout)
{
if (await semaphoreSlim.WaitAsync(millisecondsTimeout))
{
@ -28,7 +32,8 @@ public static class SemaphoreSlimExtensions
throw new TimeoutException();
}
public async static Task<IDisposable> LockAsync(this SemaphoreSlim semaphoreSlim, int millisecondsTimeout, CancellationToken cancellationToken)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public async static ValueTask<IDisposable> LockAsync(this SemaphoreSlim semaphoreSlim, int millisecondsTimeout, CancellationToken cancellationToken)
{
if (await semaphoreSlim.WaitAsync(millisecondsTimeout, cancellationToken))
{
@ -38,7 +43,8 @@ public static class SemaphoreSlimExtensions
throw new TimeoutException();
}
public async static Task<IDisposable> LockAsync(this SemaphoreSlim semaphoreSlim, TimeSpan timeout)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public async static ValueTask<IDisposable> LockAsync(this SemaphoreSlim semaphoreSlim, TimeSpan timeout)
{
if (await semaphoreSlim.WaitAsync(timeout))
{
@ -48,7 +54,8 @@ public static class SemaphoreSlimExtensions
throw new TimeoutException();
}
public async static Task<IDisposable> LockAsync(this SemaphoreSlim semaphoreSlim, TimeSpan timeout, CancellationToken cancellationToken)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public async static ValueTask<IDisposable> LockAsync(this SemaphoreSlim semaphoreSlim, TimeSpan timeout, CancellationToken cancellationToken)
{
if (await semaphoreSlim.WaitAsync(timeout, cancellationToken))
{
@ -58,18 +65,21 @@ public static class SemaphoreSlimExtensions
throw new TimeoutException();
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static IDisposable Lock(this SemaphoreSlim semaphoreSlim)
{
semaphoreSlim.Wait();
return GetDispose(semaphoreSlim);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static IDisposable Lock(this SemaphoreSlim semaphoreSlim, CancellationToken cancellationToken)
{
semaphoreSlim.Wait(cancellationToken);
return GetDispose(semaphoreSlim);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static IDisposable Lock(this SemaphoreSlim semaphoreSlim, int millisecondsTimeout)
{
if (semaphoreSlim.Wait(millisecondsTimeout))
@ -80,6 +90,7 @@ public static class SemaphoreSlimExtensions
throw new TimeoutException();
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static IDisposable Lock(this SemaphoreSlim semaphoreSlim, int millisecondsTimeout, CancellationToken cancellationToken)
{
if (semaphoreSlim.Wait(millisecondsTimeout, cancellationToken))
@ -90,6 +101,7 @@ public static class SemaphoreSlimExtensions
throw new TimeoutException();
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static IDisposable Lock(this SemaphoreSlim semaphoreSlim, TimeSpan timeout)
{
if (semaphoreSlim.Wait(timeout))
@ -100,6 +112,7 @@ public static class SemaphoreSlimExtensions
throw new TimeoutException();
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static IDisposable Lock(this SemaphoreSlim semaphoreSlim, TimeSpan timeout, CancellationToken cancellationToken)
{
if (semaphoreSlim.Wait(timeout, cancellationToken))
@ -110,6 +123,7 @@ public static class SemaphoreSlimExtensions
throw new TimeoutException();
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static IDisposable GetDispose(this SemaphoreSlim semaphoreSlim)
{
return new DisposeAction<SemaphoreSlim>(static (semaphoreSlim) =>

9
framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/LocalAbpDistributedLock.cs

@ -30,12 +30,11 @@ public class LocalAbpDistributedLock : IAbpDistributedLock, ISingletonDependency
Check.NotNullOrWhiteSpace(name, nameof(name));
var key = DistributedLockKeyNormalizer.NormalizeKey(name);
var timeoutReleaser = await _localSyncObjects.LockAsync(key, timeout, cancellationToken);
if (!timeoutReleaser.EnteredSemaphore)
var timeoutReleaser = await _localSyncObjects.LockOrNullAsync(key, timeout, cancellationToken);
if (timeoutReleaser is not null)
{
timeoutReleaser.Dispose();
return null;
return new LocalAbpDistributedLockHandle(timeoutReleaser);
}
return new LocalAbpDistributedLockHandle(timeoutReleaser);
return null;
}
}

11
framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/AbpHttpClientOptions.cs

@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.Net.Http;
using Volo.Abp.Http.Client.ClientProxying;
using Volo.Abp.Http.Client.Proxying;
namespace Volo.Abp.Http.Client;
@ -8,8 +10,17 @@ public class AbpHttpClientOptions
{
public Dictionary<Type, HttpClientProxyConfig> HttpClientProxies { get; set; }
public Dictionary<string, List<Action<HttpClientProxyConfig, ClientProxyRequestContext, HttpClient>>> ProxyHttpClientPreSendActions { get; }
public AbpHttpClientOptions()
{
HttpClientProxies = new Dictionary<Type, HttpClientProxyConfig>();
ProxyHttpClientPreSendActions = new Dictionary<string, List<Action<HttpClientProxyConfig, ClientProxyRequestContext, HttpClient>>>();
}
public AbpHttpClientOptions AddPreSendAction(string remoteServiceName, Action<HttpClientProxyConfig, ClientProxyRequestContext, HttpClient> action)
{
ProxyHttpClientPreSendActions.GetOrAdd(remoteServiceName, () => new List<Action<HttpClientProxyConfig, ClientProxyRequestContext, HttpClient>>()).Add(action);
return this;
}
}

5
framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/ClientProxying/ClientProxyBase.cs

@ -146,6 +146,11 @@ public class ClientProxyBase<TService> : ITransientDependency
HttpResponseMessage response;
try
{
foreach (var preSendAction in ClientOptions.Value.ProxyHttpClientPreSendActions.Where(x => x.Key == clientConfig.RemoteServiceName).SelectMany(x => x.Value))
{
preSendAction(clientConfig, requestContext, client);
}
response = await client.SendAsync(
requestMessage,
HttpCompletionOption.ResponseHeadersRead /*this will buffer only the headers, the content will be used as a stream*/,

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

@ -21,7 +21,7 @@
"Language": "Idioma",
"LoadMore": "Cargar más",
"ProcessingWithThreeDot": "Procesando...",
"LoadingWithThreeDot": "Cargardo...",
"LoadingWithThreeDot": "Cargando...",
"Welcome": "Bienvenido",
"Login": "Iniciar sesión",
"Register": "Registrarse",

16
framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/AbpHttpClientTestModule.cs

@ -1,8 +1,11 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Net.Http;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Http.Client;
using Volo.Abp.Http.Client.ClientProxying;
using Volo.Abp.Http.Client.Proxying;
using Volo.Abp.Http.DynamicProxying;
using Volo.Abp.Http.Localization;
using Volo.Abp.Localization;
@ -60,5 +63,16 @@ public class AbpHttpClientTestModule : AbpModule
options.FormDataConverts.Add(typeof(List<GetParamsNameValue>), typeof(TestObjectToFormData));
options.PathConverts.Add(typeof(int), typeof(TestObjectToPath));
});
Configure<AbpHttpClientOptions>(options =>
{
options.AddPreSendAction("Default", (_, requestContext, httpclient) =>
{
if (requestContext.Action.Name.Equals("TimeOutRequestAsync"))
{
httpclient.Timeout = TimeSpan.FromMilliseconds(1);
}
});
});
}
}

3
framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/IRegularTestController.cs

@ -43,4 +43,7 @@ public interface IRegularTestController
Task<int> DeleteByIdAsync(int id);
Task<string> AbortRequestAsync(CancellationToken cancellationToken = default);
Task<string> TimeOutRequestAsync();
}

8
framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestController.cs

@ -152,6 +152,14 @@ public class RegularTestController : AbpController, IRegularTestController
await Task.Delay(100, cancellationToken);
return "AbortRequestAsync";
}
[HttpGet]
[Route("timeout-request")]
public async Task<string> TimeOutRequestAsync()
{
await Task.Delay(100);
return "TimeOutRequestAsync";
}
}
public class Car

8
framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestControllerClientProxy_Tests.cs

@ -1,4 +1,5 @@
using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
@ -187,4 +188,11 @@ public class RegularTestControllerClientProxy_Tests : AbpHttpClientTestBase
var exception = await Assert.ThrowsAsync<AbpRemoteCallException>(async () => await _controller.AbortRequestAsync(cts.Token));
exception.InnerException.InnerException.InnerException.Message.ShouldBe("The client aborted the request.");
}
[Fact]
public async Task TimeOutRequestAsync()
{
var exception = await Assert.ThrowsAsync<HttpRequestException>(async () => await _controller.TimeOutRequestAsync());
exception.InnerException.InnerException.Message.ShouldBe("The client aborted the request.");
}
}

2
modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogDto.cs

@ -11,4 +11,6 @@ public class BlogDto : ExtensibleEntityDto<Guid>, IHasConcurrencyStamp
public string Slug { get; set; }
public string ConcurrencyStamp { get; set; }
public int BlogPostCount { get; set; }
}

5
modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/IBlogAdminAppService.cs

@ -1,8 +1,13 @@
using System;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
namespace Volo.CmsKit.Admin.Blogs;
public interface IBlogAdminAppService : ICrudAppService<BlogDto, Guid, BlogGetListInput, CreateBlogDto, UpdateBlogDto>
{
Task<ListResultDto<BlogDto>> GetAllListAsync();
Task MoveAllBlogPostsAsync(Guid blogId, Guid? assignToBlogId = null);
}

44
modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogAdminAppService.cs

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Volo.Abp.Application.Dtos;
@ -20,16 +21,19 @@ namespace Volo.CmsKit.Admin.Blogs;
public class BlogAdminAppService : CmsKitAdminAppServiceBase, IBlogAdminAppService
{
protected IBlogRepository BlogRepository { get; }
protected IBlogPostRepository BlogPostRepository { get; }
protected BlogManager BlogManager { get; }
protected BlogFeatureManager BlogFeatureManager { get; }
public BlogAdminAppService(
IBlogRepository blogRepository,
BlogManager blogManager,
BlogManager blogManager,
IBlogPostRepository blogPostRepository,
BlogFeatureManager blogFeatureManager = null)
{
BlogRepository = blogRepository;
BlogManager = blogManager;
BlogPostRepository = blogPostRepository;
BlogFeatureManager = blogFeatureManager;
}
@ -37,20 +41,44 @@ public class BlogAdminAppService : CmsKitAdminAppServiceBase, IBlogAdminAppServi
{
var blog = await BlogRepository.GetAsync(id);
return ObjectMapper.Map<Blog, BlogDto>(blog);
var blogDto = ObjectMapper.Map<Blog, BlogDto>(blog);
blogDto.BlogPostCount = await BlogPostRepository.GetCountAsync(blogId : blog.Id);
return blogDto;
}
public virtual async Task<PagedResultDto<BlogDto>> GetListAsync(BlogGetListInput input)
{
var totalCount = await BlogRepository.GetCountAsync(input.Filter);
var blogs = await BlogRepository.GetListAsync(
var blogs = await BlogRepository.GetListWithBlogPostCountAsync(
input.Filter,
input.Sorting,
input.MaxResultCount,
input.SkipCount);
var blogDtos = new PagedResultDto<BlogDto>(totalCount, ObjectMapper.Map<List<Blog>, List<BlogDto>>(blogs.Select(x => x.Blog).ToList()));
foreach (var blogDto in blogDtos.Items)
{
blogDto.BlogPostCount = blogs.First(x => x.Blog.Id == blogDto.Id).BlogPostCount;
}
return new PagedResultDto<BlogDto>(totalCount, ObjectMapper.Map<List<Blog>, List<BlogDto>>(blogs));
return blogDtos;
}
public virtual async Task<ListResultDto<BlogDto>> GetAllListAsync()
{
var blogs = await BlogRepository.GetListWithBlogPostCountAsync(maxResultCount: int.MaxValue);
var blogDtos = new ListResultDto<BlogDto>(ObjectMapper.Map<List<Blog>, List<BlogDto>>(blogs.Select(x => x.Blog).ToList()));
foreach (var blogDto in blogDtos.Items)
{
blogDto.BlogPostCount = blogs.First(x => x.Blog.Id == blogDto.Id).BlogPostCount;
}
return blogDtos;
}
[Authorize(CmsKitAdminPermissions.Blogs.Create)]
@ -79,10 +107,18 @@ public class BlogAdminAppService : CmsKitAdminAppServiceBase, IBlogAdminAppServi
return ObjectMapper.Map<Blog, BlogDto>(blog);
}
[Authorize(CmsKitAdminPermissions.Blogs.Delete)]
public virtual async Task MoveAllBlogPostsAsync(Guid blogId, Guid? assignToBlogId)
{
var blog = await BlogRepository.GetAsync(blogId);
await BlogPostRepository.UpdateBlogAsync(blog.Id, assignToBlogId);
}
[Authorize(CmsKitAdminPermissions.Blogs.Delete)]
public virtual Task DeleteAsync(Guid id)
{
return BlogRepository.DeleteAsync(id);
}
}

9
modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogPostAdminAppService.cs

@ -10,6 +10,7 @@ using Volo.Abp.ObjectExtending;
using Volo.Abp.Users;
using Volo.CmsKit.Admin.MediaDescriptors;
using Volo.CmsKit.Blogs;
using Volo.CmsKit.Comments;
using Volo.CmsKit.Features;
using Volo.CmsKit.GlobalFeatures;
using Volo.CmsKit.Permissions;
@ -25,6 +26,8 @@ public class BlogPostAdminAppService : CmsKitAppServiceBase, IBlogPostAdminAppSe
protected BlogPostManager BlogPostManager { get; }
protected IBlogPostRepository BlogPostRepository { get; }
protected IBlogRepository BlogRepository { get; }
protected ICommentRepository CommentRepository { get; }
protected ICmsUserLookupService UserLookupService { get; }
protected IMediaDescriptorAdminAppService MediaDescriptorAdminAppService { get; }
@ -34,13 +37,15 @@ public class BlogPostAdminAppService : CmsKitAppServiceBase, IBlogPostAdminAppSe
IBlogPostRepository blogPostRepository,
IBlogRepository blogRepository,
ICmsUserLookupService userLookupService,
IMediaDescriptorAdminAppService mediaDescriptorAdminAppService)
IMediaDescriptorAdminAppService mediaDescriptorAdminAppService,
ICommentRepository commentRepository)
{
BlogPostManager = blogPostManager;
BlogPostRepository = blogPostRepository;
BlogRepository = blogRepository;
UserLookupService = userLookupService;
MediaDescriptorAdminAppService = mediaDescriptorAdminAppService;
CommentRepository = commentRepository;
}
[Authorize(CmsKitAdminPermissions.BlogPosts.Create)]
@ -126,7 +131,7 @@ public class BlogPostAdminAppService : CmsKitAppServiceBase, IBlogPostAdminAppSe
[Authorize(CmsKitAdminPermissions.BlogPosts.Delete)]
public virtual async Task DeleteAsync(Guid id)
{
await BlogPostRepository.DeleteAsync(id);
await BlogPostManager.DeleteAsync(id);
}
[Authorize(CmsKitAdminPermissions.BlogPosts.Publish)]

2
modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/CmsKitAdminApplicationAutoMapperProfile.cs

@ -38,7 +38,7 @@ public class CmsKitAdminApplicationAutoMapperProfile : Profile
CreateMap<CreateBlogPostDto, BlogPost>(MemberList.Source).MapExtraProperties();
CreateMap<UpdateBlogPostDto, BlogPost>(MemberList.Source).MapExtraProperties();
CreateMap<Blog, BlogDto>().MapExtraProperties();
CreateMap<Blog, BlogDto>().Ignore(b => b.BlogPostCount).MapExtraProperties();
CreateMap<TagEntityTypeDefiniton, TagDefinitionDto>(MemberList.Destination);

8
modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Pages/PageAdminAppService.cs

@ -8,6 +8,7 @@ using Volo.Abp.Data;
using Volo.Abp.Features;
using Volo.Abp.GlobalFeatures;
using Volo.Abp.ObjectExtending;
using Volo.CmsKit.Comments;
using Volo.CmsKit.Features;
using Volo.CmsKit.GlobalFeatures;
using Volo.CmsKit.Pages;
@ -21,6 +22,8 @@ namespace Volo.CmsKit.Admin.Pages;
public class PageAdminAppService : CmsKitAdminAppServiceBase, IPageAdminAppService
{
protected IPageRepository PageRepository { get; }
protected ICommentRepository CommentRepository { get; }
protected PageManager PageManager { get; }
@ -29,11 +32,13 @@ public class PageAdminAppService : CmsKitAdminAppServiceBase, IPageAdminAppServi
public PageAdminAppService(
IPageRepository pageRepository,
PageManager pageManager,
IDistributedCache<PageCacheItem> pageCache)
IDistributedCache<PageCacheItem> pageCache,
ICommentRepository commentRepository)
{
PageRepository = pageRepository;
PageManager = pageManager;
PageCache = pageCache;
CommentRepository = commentRepository;
}
public virtual async Task<PageDto> GetAsync(Guid id)
@ -108,6 +113,7 @@ public class PageAdminAppService : CmsKitAdminAppServiceBase, IPageAdminAppServi
await PageRepository.DeleteAsync(page);
await PageCache.RemoveAsync(PageCacheItem.GetKey(page.Slug));
await CommentRepository.DeleteByEntityTypeAndIdAsync(PageConsts.EntityType, id.ToString());
}
[Authorize(CmsKitAdminPermissions.Pages.SetAsHomePage)]

14
modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi.Client/ClientProxies/Volo/CmsKit/Admin/Blogs/BlogAdminClientProxy.Generated.cs

@ -57,4 +57,18 @@ public partial class BlogAdminClientProxy : ClientProxyBase<IBlogAdminAppService
{ typeof(Guid), id }
});
}
public virtual async Task<ListResultDto<BlogDto>> GetAllListAsync()
{
return await RequestAsync<ListResultDto<BlogDto>>(nameof(GetAllListAsync));
}
public virtual async Task MoveAllBlogPostsAsync(Guid blogId, Guid? assignToBlogId)
{
await RequestAsync(nameof(MoveAllBlogPostsAsync), new ClientProxyRequestTypeValue
{
{ typeof(Guid), blogId },
{ typeof(Guid?), assignToBlogId }
});
}
}

117
modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi.Client/ClientProxies/cms-kit-admin-generate-proxy.json

@ -16,6 +16,39 @@
"type": "Volo.CmsKit.Admin.Blogs.IBlogAdminAppService",
"name": "IBlogAdminAppService",
"methods": [
{
"name": "GetAllListAsync",
"parametersOnMethod": [],
"returnValue": {
"type": "Volo.Abp.Application.Dtos.ListResultDto<Volo.CmsKit.Admin.Blogs.BlogDto>",
"typeSimple": "Volo.Abp.Application.Dtos.ListResultDto<Volo.CmsKit.Admin.Blogs.BlogDto>"
}
},
{
"name": "MoveAllBlogPostsAsync",
"parametersOnMethod": [
{
"name": "blogId",
"typeAsString": "System.Guid, System.Private.CoreLib",
"type": "System.Guid",
"typeSimple": "string",
"isOptional": false,
"defaultValue": null
},
{
"name": "assignToBlogId",
"typeAsString": "System.Nullable`1[[System.Guid, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib",
"type": "System.Guid?",
"typeSimple": "string?",
"isOptional": false,
"defaultValue": null
}
],
"returnValue": {
"type": "System.Void",
"typeSimple": "System.Void"
}
},
{
"name": "GetAsync",
"parametersOnMethod": [
@ -353,6 +386,90 @@
},
"allowAnonymous": false,
"implementFrom": "Volo.Abp.Application.Services.IDeleteAppService<System.Guid>"
},
"GetAllListAsync": {
"uniqueName": "GetAllListAsync",
"name": "GetAllListAsync",
"httpMethod": "GET",
"url": "api/cms-kit-admin/blogs/all",
"supportedVersions": [],
"parametersOnMethod": [],
"parameters": [],
"returnValue": {
"type": "Volo.Abp.Application.Dtos.ListResultDto<Volo.CmsKit.Admin.Blogs.BlogDto>",
"typeSimple": "Volo.Abp.Application.Dtos.ListResultDto<Volo.CmsKit.Admin.Blogs.BlogDto>"
},
"allowAnonymous": false,
"implementFrom": "Volo.CmsKit.Admin.Blogs.IBlogAdminAppService"
},
"MoveAllBlogPostsAsyncByBlogIdAndAssignToBlogId": {
"uniqueName": "MoveAllBlogPostsAsyncByBlogIdAndAssignToBlogId",
"name": "MoveAllBlogPostsAsync",
"httpMethod": "PUT",
"url": "api/cms-kit-admin/blogs/{id}/move-all-blog-posts",
"supportedVersions": [],
"parametersOnMethod": [
{
"name": "blogId",
"typeAsString": "System.Guid, System.Private.CoreLib",
"type": "System.Guid",
"typeSimple": "string",
"isOptional": false,
"defaultValue": null
},
{
"name": "assignToBlogId",
"typeAsString": "System.Nullable`1[[System.Guid, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib",
"type": "System.Guid?",
"typeSimple": "string?",
"isOptional": false,
"defaultValue": null
}
],
"parameters": [
{
"nameOnMethod": "blogId",
"name": "blogId",
"jsonName": null,
"type": "System.Guid",
"typeSimple": "string",
"isOptional": false,
"defaultValue": null,
"constraintTypes": null,
"bindingSourceId": "ModelBinding",
"descriptorName": ""
},
{
"nameOnMethod": "assignToBlogId",
"name": "assignToBlogId",
"jsonName": null,
"type": "System.Guid?",
"typeSimple": "string?",
"isOptional": false,
"defaultValue": null,
"constraintTypes": null,
"bindingSourceId": "Query",
"descriptorName": ""
},
{
"nameOnMethod": "id",
"name": "id",
"jsonName": null,
"type": null,
"typeSimple": null,
"isOptional": false,
"defaultValue": null,
"constraintTypes": [],
"bindingSourceId": "Path",
"descriptorName": ""
}
],
"returnValue": {
"type": "System.Void",
"typeSimple": "System.Void"
},
"allowAnonymous": false,
"implementFrom": "Volo.CmsKit.Admin.Blogs.IBlogAdminAppService"
}
}
},

15
modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogAdminController.cs

@ -62,4 +62,19 @@ public class BlogAdminController : CmsKitAdminController, IBlogAdminAppService
{
return BlogAdminAppService.DeleteAsync(id);
}
[HttpGet]
[Route("all")]
public Task<ListResultDto<BlogDto>> GetAllListAsync()
{
return BlogAdminAppService.GetAllListAsync();
}
[HttpPut]
[Route("{id}/move-all-blog-posts")]
[Authorize(CmsKitAdminPermissions.Blogs.Delete)]
public Task MoveAllBlogPostsAsync(Guid blogId, [FromQuery]Guid? assignToBlogId)
{
return BlogAdminAppService.MoveAllBlogPostsAsync(blogId, assignToBlogId);
}
}

59
modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Blogs/DeleteBlogModal.cshtml

@ -0,0 +1,59 @@
@page
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal
@using Volo.CmsKit.Admin.Web.Pages.CmsKit.Blogs
@using Volo.CmsKit.Localization
@model DeleteBlogModal
@inject IHtmlLocalizer<CmsKitResource> L
@{
Layout = null;
}
<form method="post" asp-page="/CmsKit/Blogs/DeleteBlogModal" autocomplete="off">
@{
var deleteAllClicked = "checked";
var deleteButtonDisabled = "";
<abp-modal>
<abp-modal-header title="@L["AreYouSure"].Value"></abp-modal-header>
<abp-modal-body>
<abp-input asp-for="Blog.Id" type="hidden"></abp-input>
<p class="fw-bold">@L.GetString("BlogDeletionConfirmationMessage", Model.Blog.Name).Value</p>
@if (Model.Blog.BlogPostCount > 0)
{
<p class="mt-2">@L.GetString("ChooseAnActionForBlog", Model.Blog.BlogPostCount).Value</p>
if (Model.Blog.OtherBlogs.Any())
{
deleteAllClicked = "";
deleteButtonDisabled = "disabled";
<div class="form-check">
<input class="form-check-input" type="radio" checked name="assign" id="assign">
<label class="form-check-label" for="assign">@L["AssignBlogPostsToOtherBlog"].Value</label>
</div>
<select name="Blog.AssignToBlogId" id="Blog_AssignToBlogId" class="form-select mt-2">
<option value="" selected>@L["SelectAnBlogToAssign"].Value</option>
@foreach (var blog in Model.Blog.OtherBlogs)
{
<option value="@blog.Key">@blog.Value</option>
}
</select>
}
<div class="form-check mt-2">
<input class="form-check-input" type="radio" @deleteAllClicked name="assign" id="deleteAll">
<label class="form-check-label" for="deleteAll">@L["DeleteAllBlogPostsOfThisBlog"].Value</label>
</div>
}
</abp-modal-body>
<abp-modal-footer>
<button class="btn btn-outline-danger" data-bs-dismiss="modal" type="button">@L["Cancel"]</button>
<button class="btn btn-danger" @deleteButtonDisabled type="submit"><i class="fa fa-trash"></i> <span>@L["Delete"]</span></button>
</abp-modal-footer>
</abp-modal>
}
</form>

57
modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Blogs/DeleteBlogModal.cshtml.cs

@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Volo.Abp.ObjectExtending;
using Volo.CmsKit.Admin.Blogs;
namespace Volo.CmsKit.Admin.Web.Pages.CmsKit.Blogs;
public class DeleteBlogModal : CmsKitAdminPageModel
{
[BindProperty]
public BlogInfoModel Blog { get; set; }
protected IBlogAdminAppService BlogAdminAppService { get; }
public DeleteBlogModal(IBlogAdminAppService blogAdminAppService)
{
BlogAdminAppService = blogAdminAppService;
}
public virtual async Task OnGetAsync(Guid id)
{
var blog = await BlogAdminAppService.GetAsync(id);
var allBlogs = await BlogAdminAppService.GetAllListAsync();
Blog = new BlogInfoModel
{
Id = blog.Id,
Name = blog.Name,
BlogPostCount = blog.BlogPostCount,
OtherBlogs = allBlogs.Items.Where(b => b.Id != blog.Id).Select(e => new KeyValuePair<Guid, string>(e.Id, e.Name)).ToList()
};
}
public virtual async Task<IActionResult> OnPostAsync()
{
await BlogAdminAppService.MoveAllBlogPostsAsync(Blog.Id, Blog.AssignToBlogId);
await BlogAdminAppService.DeleteAsync(Blog.Id);
return NoContent();
}
public class BlogInfoModel : ExtensibleObject
{
public Guid Id { get; set; }
public string Name { get; set; }
public int BlogPostCount { get; set; }
public List<KeyValuePair<Guid, string>> OtherBlogs { get; set; }
public Guid? AssignToBlogId { get; set; }
}
}

46
modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Blogs/index.js

@ -6,6 +6,35 @@ $(function () {
var updateModal = new abp.ModalManager({ viewUrl: abp.appPath + "CmsKit/Blogs/UpdateModal", modalClass: 'updateBlog' });
var featuresModal = new abp.ModalManager(abp.appPath + "CmsKit/Blogs/FeaturesModal");
var deleteBlogModal = new abp.ModalManager(abp.appPath + 'CmsKit/Blogs/DeleteBlogModal');
deleteBlogModal.onResult(function(){
abp.notify.success(l('DeletedSuccessfully'));
});
deleteBlogModal.onOpen(function () {
var $form = deleteBlogModal.getForm();
$form.find('#assign').click(function () {
$form.find('#Blog_AssignToBlogId').show();
$form.find('[type=submit]').attr("disabled","disabled")
})
$form.find('#deleteAll').click(function () {
$form.find('#Blog_AssignToBlogId').hide();
$form.find('#Blog_AssignToBlogId').val("");
$form.find('[type=submit]').removeAttr("disabled");
})
$("#Blog_AssignToBlogId").on("change", function () {
var val = $(this).val();
if(val === ''){
$form.find('[type=submit]').attr("disabled","disabled")
}else{
$form.find('[type=submit]').removeAttr("disabled");
}
})
})
var blogsService = volo.cmsKit.admin.blogs.blogAdmin;
var dataTable = $("#BlogsTable").DataTable(abp.libs.datatables.normalizeConfiguration({
@ -41,16 +70,10 @@ $(function () {
{
text: l('Delete'),
visible: abp.auth.isGranted('CmsKit.Blogs.Delete'),
confirmMessage: function (data) {
return l("BlogDeletionConfirmationMessage", data.record.name)
},
action: function (data) {
blogsService
.delete(data.record.id)
.then(function () {
dataTable.ajax.reloadEx();
abp.notify.success(l('DeletedSuccessfully'));
});
deleteBlogModal.open({
id: data.record.id
});
}
}
]
@ -74,6 +97,7 @@ $(function () {
createModal.open();
});
createModal.onResult(function () {
dataTable.ajax.reloadEx();
});
@ -81,4 +105,8 @@ $(function () {
updateModal.onResult(function () {
dataTable.ajax.reloadEx();
});
deleteBlogModal.onResult(function () {
dataTable.ajax.reloadEx();
});
});

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

Loading…
Cancel
Save