diff --git a/Directory.Packages.props b/Directory.Packages.props
index 0d61ef436a..b7409b5c8f 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -186,5 +186,6 @@
+
\ No newline at end of file
diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json
index abd7184278..7ef0ca75e9 100644
--- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json
+++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json
@@ -1910,6 +1910,7 @@
"DoYouSupportCustomABPArchitectures": "Do you support custom ABP architectures?",
"SupportCustomABPArchitecturesExplanation": "No. Support is only provided for standard ABP solution structures. On the other hand, you can always get support for your custom needs with a paid consultancy from the ABP Team.",
"DoesABPCollectAnyPersonalOrTechnicalData": "Does ABP collect any personal or technical data?",
- "ABPCollectAnyDataExplanation": "The software may collect information about you and your use of the software, and send that to Volosoft. Volosoft as the software and service provider may use this information to provide services and improve its products & services. You may opt-out of these scenarios, as described in the EULA under PRIVACY AND COLLECTION OF PERSONAL DATA topic ."
+ "ABPCollectAnyDataExplanation": "The software may collect information about you and your use of the software, and send that to Volosoft. Volosoft as the software and service provider may use this information to provide services and improve its products & services. You may opt-out of these scenarios, as described in the EULA under PRIVACY AND COLLECTION OF PERSONAL DATA topic .",
+ "InThisDocument": "In this document"
}
}
diff --git a/docs/en/Community-Articles/2025-08-25-App-Services-vs-Domain-Services/POST.md b/docs/en/Community-Articles/2025-08-25-App-Services-vs-Domain-Services/POST.md
new file mode 100644
index 0000000000..534dc1abe1
--- /dev/null
+++ b/docs/en/Community-Articles/2025-08-25-App-Services-vs-Domain-Services/POST.md
@@ -0,0 +1,213 @@
+# App Services vs Domain Services: Deep Dive into Two Core Service Types in ABP Framework
+
+In ABP's layered architecture, we frequently encounter two types of services that appear similar but serve distinctly different purposes: Application Services and Domain Services. Understanding the differences between them is crucial for building clear and maintainable enterprise applications.
+
+## Architectural Positioning
+
+In ABP's layered architecture:
+
+- **Application Services** reside in the application layer and are responsible for coordinating use case execution
+- **Domain Services** reside in the domain layer and are responsible for implementing core business logic
+
+This layered design follows Domain-Driven Design (DDD) principles, ensuring clear separation of business logic and system maintainability.
+
+## Application Services: Use Case Orchestrators
+
+### Core Responsibilities
+
+Application Services are stateless services primarily used to implement application use cases. They act as a bridge between the presentation layer and domain layer, responsible for:
+
+- **Parameter Validation**: Input validation is automatically handled by ABP using data annotations
+- **Authorization**: Checking user permissions and access control using `[Authorize]` attribute or manual authorization checks via `IAuthorizationService`
+- **Transaction Management**: Methods automatically run as Unit of Work (transactional by default)
+- **Use Case Orchestration**: Organizing and coordinating multiple domain objects to complete specific business use cases
+- **Data Transformation**: Handling conversion between DTOs and domain objects using ObjectMapper
+
+### Design Principles
+
+1. **DTO Boundaries**: Application service methods should only accept and return DTOs, never directly expose domain entities
+2. **Use Case Oriented**: Each method should correspond to a clear user use case
+3. **Thin Layer Design**: Avoid implementing complex business logic in application services
+
+### Typical Execution Flow
+
+A standard application service method typically follows this pattern:
+
+```csharp
+[Authorize(BookPermissions.Create)] // Declarative authorization
+public virtual async Task CreateBookAsync(CreateBookDto input) // input is automatically validated
+{
+ // Get related data
+ var author = await _authorRepository.GetAsync(input.AuthorId);
+
+ // Call domain service to execute business logic (if needed)
+ // You can also use the entity constructor directly if no complex business logic is required
+ var book = await _bookManager.CreateAsync(input.Title, author, input.Price);
+
+ // Persist changes
+ await _bookRepository.InsertAsync(book);
+
+ // Return DTO
+ return ObjectMapper.Map(book);
+}
+```
+
+### Integration Services: Special kind of Application Service
+
+It's worth mentioning that ABP also provides a special type of application service—Integration Services. They are application services marked with the `[IntegrationService]` attribute, designed for inter-module or inter-microservice communication.
+
+We have a community article dedicated to integration services: [Integration Services Explained — What they are, when to use them, and how they behave](https://abp.io/community/articles/integration-services-explained-what-they-are-when-to-use-lienmsy8)
+
+## Domain Services: Guardians of Business Logic
+
+### Core Responsibilities
+
+Domain Services implement core business logic and are particularly needed when:
+
+- **Core domain logic depends on services**: You need to implement logic that requires repositories or other external services
+- **Logic spans multiple aggregates**: The business logic is related to more than one aggregate/entity and doesn't properly fit in any single aggregate
+- **Complex business rules**: Complex domain rules that don't naturally belong in a single entity
+
+### Design Principles
+
+1. **Domain Object Interaction**: Method parameters and return values should be domain objects (entities, value objects), never DTOs
+2. **Business Logic Focus**: Focus on implementing pure business rules
+3. **Stateless Design**: Maintain the stateless nature of services
+4. **State-Changing Operations Only**: Domain services should only define methods that mutate data, not query methods
+5. **No Authorization Logic**: Domain services should not perform authorization checks or depend on current user context
+6. **Specific Method Names**: Use descriptive, business-meaningful method names (e.g., `AssignToAsync`) instead of generic names (e.g., `UpdateAsync`)
+
+### Implementation Example
+
+```csharp
+public class IssueManager : DomainService
+{
+ private readonly IRepository _issueRepository;
+
+ public virtual async Task AssignToAsync(Issue issue, Guid userId)
+ {
+ // Business rule: Check user's unfinished task count
+ var openIssueCount = await _issueRepository.GetCountAsync(i => i.AssignedUserId == userId && !i.IsClosed);
+
+ if (openIssueCount >= 3)
+ {
+ throw new BusinessException("IssueTracking:ConcurrentOpenIssueLimit");
+ }
+
+ // Execute assignment logic
+ issue.AssignedUserId = userId;
+ issue.AssignedDate = Clock.Now;
+ }
+}
+```
+
+## Key Differences Comparison
+
+| Dimension | Application Services | Domain Services |
+|-----------|---------------------|-----------------|
+| **Layer Position** | Application Layer | Domain Layer |
+| **Primary Responsibility** | Use Case Orchestration | Business Logic Implementation |
+| **Data Interaction** | DTOs | Domain Objects |
+| **Callers** | Presentation Layer/Client Applications | Application Services/Other Domain Services |
+| **Authorization** | Responsible for permission checks | No authorization logic |
+| **Transaction Management** | Manages transaction boundaries (Unit of Work) | Participates in transactions but doesn't manage |
+| **Current User Context** | Can access current user information | Should not depend on current user context |
+| **Return Types** | Returns DTOs | Returns domain objects only |
+| **Query Operations** | Can perform query operations | Should not define GET/query methods |
+| **Naming Convention** | `*AppService` | `*Manager` or `*Service` |
+
+## Collaboration Patterns in Practice
+
+In real-world development, these two types of services typically work together:
+
+```csharp
+// Application Service
+public class BookAppService : ApplicationService
+{
+ private readonly BookManager _bookManager;
+ private readonly IRepository _bookRepository;
+
+ [Authorize(BookPermissions.Update)]
+ public virtual async Task UpdatePriceAsync(Guid id, decimal newPrice)
+ {
+ var book = await _bookRepository.GetAsync(id);
+
+ await _bookManager.ChangePriceAsync(book, newPrice);
+
+ await _bookRepository.UpdateAsync(book);
+
+ return ObjectMapper.Map(book);
+ }
+}
+
+// Domain Service
+public class BookManager : DomainService
+{
+ public virtual async Task ChangePriceAsync(Book book, decimal newPrice)
+ {
+ // Domain service focuses on business rules
+ if (newPrice <= 0)
+ {
+ throw new BusinessException("Book:InvalidPrice");
+ }
+
+ if (book.IsDiscounted && newPrice > book.OriginalPrice)
+ {
+ throw new BusinessException("Book:DiscountedPriceCannotExceedOriginal");
+ }
+
+ if (book.Price == newPrice)
+ {
+ return;
+ }
+
+ // Additional business logic: Check if price change requires approval
+ if (await RequiresApprovalAsync(book, newPrice))
+ {
+ throw new BusinessException("Book:PriceChangeRequiresApproval");
+ }
+
+ book.ChangePrice(newPrice);
+ }
+
+ private Task RequiresApprovalAsync(Book book, decimal newPrice)
+ {
+ // Example business rule: Large price increases require approval
+ var increasePercentage = ((newPrice - book.Price) / book.Price) * 100;
+ return Task.FromResult(increasePercentage > 50); // 50% increase threshold
+ }
+}
+```
+
+## Best Practice Recommendations
+
+### Application Services
+- Create a corresponding application service for each aggregate root
+- Use clear naming conventions (e.g., `IBookAppService`)
+- Implement standard CRUD operation methods (`GetAsync`, `CreateAsync`, `UpdateAsync`, `DeleteAsync`)
+- Avoid inter-application service calls within the same module/application
+- Always return DTOs, never expose domain entities directly
+- Use the `[Authorize]` attribute for declarative authorization or manual checks via `IAuthorizationService`
+- Methods automatically run as Unit of Work (transactional)
+- Input validation is handled automatically by ABP
+
+### Domain Services
+- Use the `Manager` suffix for naming (e.g., `BookManager`)
+- Only define state-changing methods, avoid query methods (use repositories directly in Application Services for queries)
+- Throw `BusinessException` with clear, unique error codes for domain validation failures
+- Keep methods pure, avoid involving user context or authorization logic
+- Accept and return domain objects only, never DTOs
+- Use descriptive, business-meaningful method names (e.g., `AssignToAsync`, `ChangePriceAsync`)
+- Do not implement interfaces unless there's a specific need for multiple implementations
+
+## Summary
+
+Application Services and Domain Services each have their distinct roles in the ABP framework: Application Services serve as use case orchestrators, handling authorization, validation, transaction management, and DTO transformations; Domain Services focus purely on business logic implementation without any infrastructure concerns. Integration Services are a special type of Application Service designed for inter-service communication.
+
+Correctly understanding and applying these service patterns is key to building high-quality ABP applications. Through clear separation of responsibilities, we can not only build more maintainable code but also flexibly switch between monolithic and microservice architectures—this is precisely the elegance of ABP framework design.
+
+## References
+
+- [Application Services](https://abp.io/docs/latest/framework/architecture/domain-driven-design/application-services)
+- [Integration Services](https://abp.io/docs/latest/framework/api-development/integration-services)
+- [Domain Services](https://abp.io/docs/latest/framework/architecture/domain-driven-design/domain-services)
diff --git a/docs/en/Community-Articles/2025-08-25-App-Services-vs-Domain-Services/cover.png b/docs/en/Community-Articles/2025-08-25-App-Services-vs-Domain-Services/cover.png
new file mode 100644
index 0000000000..a59643d12a
Binary files /dev/null and b/docs/en/Community-Articles/2025-08-25-App-Services-vs-Domain-Services/cover.png differ
diff --git a/docs/en/Community-Articles/2025-08-25-AutoMapper-Alternatives/AutoMapper-Alternatives.md b/docs/en/Community-Articles/2025-08-25-AutoMapper-Alternatives/AutoMapper-Alternatives.md
new file mode 100644
index 0000000000..e9c4dec4ee
--- /dev/null
+++ b/docs/en/Community-Articles/2025-08-25-AutoMapper-Alternatives/AutoMapper-Alternatives.md
@@ -0,0 +1,338 @@
+# Best Free Alternatives to AutoMapper in .NET — Why We Moved to Mapperly
+
+---
+
+## Introduction
+
+[AutoMapper](https://automapper.io/) has been one of the most popular mapping library for .NET apps. It has been free and [open-source](https://github.com/LuckyPennySoftware/AutoMapper) since 2009. On 16 April 2025, Jimmy Bogard (the owner of the project) decided to make it commercial for his own reasons. You can read [this announcement](https://www.jimmybogard.com/automapper-and-mediatr-licensing-update/) about what happened to AutoMapper.
+
+
+
+### Why AutoMapper’s licensing change matters
+
+In ABP Framework we have been also using AutoMapper for object mappings. After its commercial transition, we also needed to replace it. Because ABP Framework is open-source and under [LGPL-3.0 license](https://github.com/abpframework/abp#LGPL-3.0-1-ov-file).
+
+**TL;DR**
+
+> That's why, **we decided to replace AutoMapper with Mapperly**.
+
+In this article, we'll discuss the alternatives of AutoMapper so that you can cut down on costs and maximize performance while retaining control over your codebase. Also I'll explain why we chose Mapperly.
+
+Also AutoMapper uses heavily reflection. And reflection comes with a performance cost if used indiscriminately, and compile-time safety is limited. Let's see how we can overcome these...
+
+
+
+## Cost-Free Alternatives to AutoMapper
+
+Check out the comparison table for key features vs. AutoMapper.
+
+| | **AutoMapper (Paid)** | **Mapster (Free)** | **Mapperly (Free)** | **AgileMapper (Free)** | **Manual Mapping** |
+| ------------------- | ----------------------------------------------- | ----------------------------------------- | -------------------------------------------- | ------------------------------------------- | ------------------------------------------------ |
+| **License & Cost** | Paid/commercial | Free, MIT License | Free, MIT License | Free, Apache 2.0 | Free (no library) |
+| **Performance** | Slower due to reflection & conventions | Very fast (runtime & compile-time modes) | Very fast (compile-time code generation) | Good, faster than AutoMapper | Fastest (direct assignment) |
+| **Ease of Setup** | Easy, but configuration-heavy | Easy, minimal config | Easy, but different approach from AutoMapper | Simple, flexible configuration | Manual coding required |
+| **Features** | Rich features, conventions, nested mappings | Strong typed mappings, projection support | Strong typed, compile-time safe mappings | Dynamic & conditional mapping | Whatever you code |
+| **Maintainability** | Hidden mappings can be hard to debug | Explicit & predictable | Very explicit, compiler-verified mappings | Readable, good balance | Very explicit, most maintainable |
+| **Best For** | Large teams used to AutoMapper & willing to pay | Teams wanting performance + free tool | Teams prioritizing type-safety & performance | Developers needing flexibility & simplicity | Small/medium projects, performance-critical apps |
+
+There are other libraries such as [**ExpressMapper**](https://github.com/fluentsprings/ExpressMapper) **(308 GitHub stars)**, [**ValueInjecter**](https://github.com/omuleanu/ValueInjecter) **(258 GitHub stars)**, [**AgileMapper**](https://github.com/agileobjects/AgileMapper) **(463 GitHub stars)**. These are not very popular but also free and offer a different balance of simplicity and features.
+
+
+
+## Why We Chose Mapperly
+
+We filtered down all the alternatives into 2: **Mapster** and **Mapperly**.
+
+The crucial factor was maintainability! As you see from the screenshots below, Mapster is already stopped development. Mapster’s development appears stalled, and its future maintenance is uncertain. On the other hand, Mapperly regularly gets commits. The community support is valuable.
+
+We looked up different alternatives of AutoMapper also, here's the initial issue of AutoMapper replacement [github.com/abpframework/abp/issues/23243](https://github.com/abpframework/abp/issues/23243).
+
+The ABP team started Mapperly integration with this initial commit [github.com/abpframework/abp/commit/178d3f56d42b4e5acb7e349470f4a644d4c5214e](https://github.com/abpframework/abp/commit/178d3f56d42b4e5acb7e349470f4a644d4c5214e). And this is our Mapperly integration package : [github.com/abpframework/abp/tree/dev/framework/src/Volo.Abp.Mapperly.](https://github.com/abpframework/abp/tree/dev/framework/src/Volo.Abp.Mapperly.)
+
+
+
+Here are some considerations for developers who are used to ABP and AutoMapper.
+
+### [Mapster](https://github.com/MapsterMapper/Mapster):
+
+* ✔ It is similar to AutoMapper, configuring mappings through code.
+* ✔ Support for dependency injection and complex runtime configuration.
+* ❌ It is looking additional Mapster maintainers ([Call for additional Mapster maintainers MapsterMapper/Mapster#752](https://github.com/MapsterMapper/Mapster/discussions/752))
+
+### [Mapperly](https://github.com/riok/Mapperly):
+
+- ✔ It generates mapping code(` source generator`) during the build process.
+- ✔ It is actively being developed and maintained.
+- ❌ It is a static `map` method, which is not friendly to dependency injection.
+- ❌ The configuration method is completely different from AutoMapper, and there is a learning curve.
+
+
+
+**Mapperly** → generates mapping code at **compile time** using source generators.
+
+**Mapster** → has two modes:
+
+- By default, it uses **runtime code generation** (via expression trees and compilation).
+
+- But with **Mapster.Tool** (source generator), it can also generate mappings at **compile time**.
+
+
+
+This is important because it guarantees the mappings are working well. Also they provide type safety and improved performance. Another advantages of these libraries, they eliminate runtime surprises and offer better IDE support.
+
+---
+
+## When Mapperly Will Come To ABP
+
+Mapperly integration will be delivered with ABP v10. If you have already defined AutoMapper configurations, you can still keep and use them. But the framework will use Mapperly. So there'll be 2 mapping integrations in your app. You can also remove AutoMapper from your final application and use one mapping library: Mapperly. It's up to you! Check [AutoMapper pricing table](https://automapper.io/#pricing).
+
+
+
+## Migrating from AutoMapper to Mapperly
+
+In ABP v10, we will be migrating from AutoMapper to Mapperly. The document about the migration is not delivered by the time I wrote this article, but you can reach the document in our dev docs branch
+
+* [github.com/abpframework/abp/blob/dev/docs/en/release-info/migration-guides/AutoMapper-To-Mapperly.md](https://github.com/abpframework/abp/blob/dev/docs/en/release-info/migration-guides/AutoMapper-To-Mapperly.md).
+
+Also for ABP, you can check out how you will define DTO mappings based on Mapperly at this document
+
+* [github.com/abpframework/abp/blob/dev/docs/en/framework/infrastructure/object-to-object-mapping.md](https://github.com/abpframework/abp/blob/dev/docs/en/framework/infrastructure/object-to-object-mapping.md)
+
+
+
+## Mapping Code Examples for AutoMapper, Mapster, AgileMapper
+
+### AutoMapper vs Mapster vs Mapperly Performance
+
+Here are concise, drop-in **side-by-side C# snippets** that map the same model with AutoMapper, Mapster, AgileMapper, and manual mapping.
+
+ Models used in all examples
+
+We'll use these models to show the mapping examples for AutoMapper, Mapster, AgileMapper.
+
+```csharp
+public class Order
+{
+ public int Id { get; set; }
+ public Customer Customer { get; set; } = default!;
+ public List Lines { get; set; } = new();
+ public DateTime CreatedAt { get; set; }
+}
+
+public class Customer
+{
+ public int Id { get; set; }
+ public string Name { get; set; } = "";
+ public string? Email { get; set; }
+}
+
+public class OrderLine
+{
+ public int ProductId { get; set; }
+ public int Quantity { get; set; }
+ public decimal UnitPrice { get; set; }
+}
+
+public class OrderDto
+{
+ public int Id { get; set; }
+ public string CustomerName { get; set; } = "";
+ public int ItemCount { get; set; }
+ public decimal Total { get; set; }
+ public string CreatedAtIso { get; set; } = "";
+}
+```
+
+
+
+#### AutoMapper Example (Paid)
+
+```csharp
+public sealed class OrderProfile : Profile
+{
+ public OrderProfile()
+ {
+ CreateMap()
+ .ForMember(d => d.CustomerName, m => m.MapFrom(s => s.Customer.Name))
+ .ForMember(d => d.ItemCount, m => m.MapFrom(s => s.Lines.Sum(l => l.Quantity)))
+ .ForMember(d => d.Total, m => m.MapFrom(s => s.Lines.Sum(l => l.Quantity * l.UnitPrice)))
+ .ForMember(d => d.CreatedAtIso,m => m.MapFrom(s => s.CreatedAt.ToString("O")));
+ }
+}
+
+// registration
+services.AddAutoMapper(typeof(OrderProfile));
+
+// mapping
+var dto = mapper.Map(order);
+
+// EF Core projection (common pattern)
+var list = dbContext.Orders
+ .ProjectTo(mapper.ConfigurationProvider)
+ .ToList();
+```
+
+**NuGet Packages:**
+
+- https://www.nuget.org/packages/AutoMapper
+- https://www.nuget.org/packages/AutoMapper.Extensions.Microsoft.DependencyInjection
+
+---
+
+#### Mapperly (Free, Apache-2.0)
+
+This is compile-time generated mapping.
+
+```csharp
+[Mapper] // generates the implementation at build time
+public partial class OrderMapper
+{
+ // Simple property mapping: Customer.Name -> CustomerName
+ [MapProperty(nameof(Order.Customer) + "." + nameof(Customer.Name), nameof(OrderDto.CustomerName))]
+ public partial OrderDto ToDto(Order source);
+
+ // Update an existing target (like MapToExisting)
+ [MapProperty(nameof(Order.Customer) + "." + nameof(Customer.Name), nameof(OrderDto.CustomerName))]
+ public partial void UpdateDto(Order source, OrderDto target);
+
+ public OrderDto Map(Order s)
+ {
+ var d = ToDto(s);
+ AfterMap(s, d);
+ return d;
+ }
+
+ public void Map(Order source, OrderDto d)
+ {
+ UpdateDto(source, d);
+ AfterMap(source, d);
+ }
+
+ private void AfterMap(Order source, OrderDto d)
+ {
+ d.ItemCount = source.Lines.Sum(l => l.Quantity);
+ d.Total = source.Lines.Sum(l => l.Quantity * l.UnitPrice);
+ d.CreatedAtIso = source.CreatedAt.ToString("O");
+ }
+}
+
+
+//USAGE
+var mapper = new OrderMapper();
+var order = new Order
+{
+ Id = 1,
+ Customer = new Customer { Id = 1, Name = "John Doe", Email = "johndoe@abp.io" },
+ Lines =
+ [
+ new OrderLine {ProductId = 1, Quantity = 2, UnitPrice = 10.0m},
+ new OrderLine {ProductId = 2, Quantity = 1, UnitPrice = 20.0m}
+ ]
+};
+
+// Map to a new object
+var dto = mapper.Map(order);
+
+// Map to an existing object
+var target = new OrderDto();
+mapper.Map(order, target);
+```
+
+**NuGet Packages:**
+
+* https://www.nuget.org/packages/Riok.Mapperly/
+
+---
+
+#### Mapster Example (Free, MIT)
+
+```csharp
+TypeAdapterConfig.NewConfig()
+ .Map(d => d.CustomerName, s => s.Customer.Name)
+ .Map(d => d.ItemCount, s => s.Lines.Sum(l => l.Quantity))
+ .Map(d => d.Total, s => s.Lines.Sum(l => l.Quantity * l.UnitPrice))
+ .Map(d => d.CreatedAtIso, s => s.CreatedAt.ToString("O"));
+
+// one-off
+var dto = order.Adapt();
+
+// DI-friendly registration
+services.AddSingleton(TypeAdapterConfig.GlobalSettings);
+services.AddScoped();
+
+// EF Core projection (strong suit)
+var mappedList = dbContext.Orders
+ .ProjectToType() // Mapster projection
+ .ToList();
+```
+
+**NuGet Packages:**
+
+- https://www.nuget.org/packages/Mapster
+- https://www.nuget.org/packages/Mapster.DependencyInjection
+- https://www.nuget.org/packages/Mapster.SourceGenerator (for performance improvement)
+
+---
+
+#### AgileMapper Example (Free, Apache-2.0)
+
+```csharp
+var mapper = Mapper.CreateNew(cfg =>
+{
+ cfg.WhenMapping
+ .From()
+ .To()
+ .Map(ctx => ctx.Source.Customer.Name).To(dto => dto.CustomerName)
+ .Map(ctx => ctx.Source.Lines.Sum(l => l.Quantity)).To(dto => dto.ItemCount)
+ .Map(ctx => ctx.Source.Lines.Sum(l => l.Quantity * l.UnitPrice)).To(dto => dto.Total)
+ .Map(ctx => ctx.Source.CreatedAt.ToString("O")).To(dto => dto.CreatedAtIso);
+});
+
+var mappedDto = mapper.Map(order).ToANew();
+```
+
+**NuGet Packages:**
+
+* https://www.nuget.org/packages/AgileObjects.AgileMapper
+
+
+---
+
+#### Manual (Pure) Mapping (no library)
+
+Straightforward, fastest, and most explicit. Good for simple applications which doesn't need long term maintenance. Hand-written mapping is faster, safer, and more maintainable. And for tiny mappings, you can still use manual mapping.
+
+* Examples of when manual mapping is better than libraries.
+
+```csharp
+public static class OrderMapping
+{
+ public static OrderDto ToDto(this Order s) => new()
+ {
+ Id = s.Id,
+ CustomerName = s.Customer.Name,
+ ItemCount = s.Lines.Sum(l => l.Quantity),
+ Total = s.Lines.Sum(l => l.Quantity * l.UnitPrice),
+ CreatedAtIso = s.CreatedAt.ToString("O")
+ };
+}
+
+// usage
+var dto = order.ToDto();
+
+// EF Core projection (best for perf + SQL translation)
+var mappedList = dbContext.Orders.Select(s => new OrderDto
+ {
+ Id = s.Id,
+ CustomerName = s.Customer.Name,
+ ItemCount = s.Lines.Sum(l => l.Quantity),
+ Total = s.Lines.Sum(l => l.Quantity * l.UnitPrice),
+ CreatedAtIso = s.CreatedAt.ToString("O")
+ }).ToList();
+```
+
+
+
+### Conclusion
+
+If you rely on AutoMapper today, it’s time to evaluate alternatives. For ABP Framework, we chose **Mapperly** due to active development, strong community, and compile-time performance. But your team may prefer **Mapster** for flexibility or even manual mapping for small apps. Your requirements might be different, your project is not a framework so you decide the best one for you.
diff --git a/docs/en/Community-Articles/2025-08-25-AutoMapper-Alternatives/cover.png b/docs/en/Community-Articles/2025-08-25-AutoMapper-Alternatives/cover.png
new file mode 100644
index 0000000000..d1c7e26166
Binary files /dev/null and b/docs/en/Community-Articles/2025-08-25-AutoMapper-Alternatives/cover.png differ
diff --git a/docs/en/Community-Articles/2025-08-25-AutoMapper-Alternatives/mapster-mapperly-community-powers.png b/docs/en/Community-Articles/2025-08-25-AutoMapper-Alternatives/mapster-mapperly-community-powers.png
new file mode 100644
index 0000000000..c2e3adbbfc
Binary files /dev/null and b/docs/en/Community-Articles/2025-08-25-AutoMapper-Alternatives/mapster-mapperly-community-powers.png differ
diff --git a/docs/en/Community-Articles/2025-08-27-Building-a-permission-based-authorization-system-for-net-core/POST.md b/docs/en/Community-Articles/2025-08-27-Building-a-permission-based-authorization-system-for-net-core/POST.md
new file mode 100644
index 0000000000..2d6c98102f
--- /dev/null
+++ b/docs/en/Community-Articles/2025-08-27-Building-a-permission-based-authorization-system-for-net-core/POST.md
@@ -0,0 +1,174 @@
+# Building a Permission-Based Authorization System for ASP.NET Core
+
+In this article, we'll explore different authorization approaches in ASP.NET Core and examine how ABP's permission-based authorization system works.
+
+First, we'll look at some of the core authorization types that come with ASP.NET Core, such as role-based, claims-based, policy-based, and resource-based authorization. We'll briefly review the pros and cons of each approach.
+
+Then, we'll dive into [ABP's Permission-Based Authorization System](https://abp.io/docs/latest/framework/fundamentals/authorization#permission-system). This is a more advanced approach that gives you fine-grained control over what users can do in your application. We'll also explore ABP's Permission Management Module, which makes managing permissions through the UI easily.
+
+## Understanding ASP.NET Core Authorization Types
+
+Before diving into permission-based authorization, let's examine some of the core authorization types available in ASP.NET Core:
+
+- **[Role-Based Authorization](https://learn.microsoft.com/en-us/aspnet/core/security/authorization/roles?view=aspnetcore-9.0)** checks if the current user belongs to specific roles (like **"Admin"** or **"User"**) and grants access based on these roles. (For example, only users in the **"Manager"** role can access the employee salary management page.)
+
+- **[Claims-Based Authorization](https://learn.microsoft.com/en-us/aspnet/core/security/authorization/claims?view=aspnetcore-9.0)** uses key-value pairs (claims) that describe user attributes, such as age, department, or security clearance. (For example, only users with a **"Department=Finance"** claim can view financial reports.) This provides more granular control but requires careful claim management (such as grouping claims under policies).
+
+- **[Policy-Based Authorization](https://learn.microsoft.com/en-us/aspnet/core/security/authorization/policies?view=aspnetcore-9.0)** combines multiple requirements (roles, claims, custom logic) into reusable policies. It offers flexibility and centralized management, and **this is exactly why ABP's permission system is built on top of it!** (We'll discuss this in more detail later.)
+
+- **[Resource-Based Authorization](https://learn.microsoft.com/en-us/aspnet/core/security/authorization/resourcebased?view=aspnetcore-9.0)** determines access by examining both the user and the specific item they want to access. (For example, a user can edit only their own blog posts, not others' posts.) Unlike policy-based authorization which applies the same rules everywhere, resource-based authorization makes decisions based on the actual data being accessed, requiring more complex implementation.
+
+Here's a quick comparison of these approaches:
+
+| Authorization Type | Pros | Cons |
+|-------------------|------|------|
+| **Role-Based** | Simple implementation, easy to understand | Becomes inflexible with complex role hierarchies |
+| **Claims-Based** | Granular control, flexible user attributes | Complex claim management, potential for claim explosion |
+| **Policy-Based** | Centralized logic, combines multiple requirements | Can become complex with numerous policies |
+| **Resource-Based** | Fine-grained per-resource control | Implementation complexity, resource-specific code |
+
+## What is Permission-Based Authorization?
+
+Permission-based authorization takes a different approach from other authorization types by defining specific permissions (like **"CreateUser"**, **"DeleteOrder"**, **"ViewReports"**) that represent granular actions within your application. These permissions can be assigned to users directly or through roles, providing both flexibility and clear action-based access control.
+
+ABP Framework's permission system is built on top of this approach and extends ASP.NET Core's policy-based authorization system, working seamlessly with it.
+
+## ABP Framework's Permission System
+
+ABP extends [ASP.NET Core Authorization](https://learn.microsoft.com/en-us/aspnet/core/security/authorization/introduction?view=aspnetcore-9.0) by adding **permissions** as automatic [policies](https://learn.microsoft.com/en-us/aspnet/core/security/authorization/policies?view=aspnetcore-9.0) and allows the authorization system to be used in application services as well.
+
+This system provides a clean abstraction while maintaining full compatibility with ASP.NET Core's authorization infrastructure.
+
+ABP also provides a [Permission Management Module](https://abp.io/docs/latest/modules/permission-management) that offers a complete UI and API for managing permissions. This allows you to easily manage permissions in the UI, assign permissions to roles or users, and much more. (We'll see how to use it in the following sections.)
+
+### Defining Permissions in ABP
+
+In ABP, permissions are defined in classes (typically under the `*.Application.Contracts` project) that inherit from the `PermissionDefinitionProvider` class. Here's how you can define permissions for a book management system:
+
+```csharp
+public class BookStorePermissionDefinitionProvider : PermissionDefinitionProvider
+{
+ public override void Define(IPermissionDefinitionContext context)
+ {
+ var bookStoreGroup = context.AddGroup("BookStore");
+
+ var booksPermission = bookStoreGroup.AddPermission("BookStore.Books", L("Permission:Books"));
+ booksPermission.AddChild("BookStore.Books.Create", L("Permission:Books.Create"));
+ booksPermission.AddChild("BookStore.Books.Edit", L("Permission:Books.Edit"));
+ booksPermission.AddChild("BookStore.Books.Delete", L("Permission:Books.Delete"));
+ }
+
+ private static LocalizableString L(string name)
+ {
+ return LocalizableString.Create(name);
+ }
+}
+```
+
+ABP automatically discovers this class and registers the permissions/policies in the system. You can then assign these permissions/policies to users/roles. There are two ways to do this:
+
+* Using the [Permission Management Module](https://abp.io/docs/latest/modules/permission-management)
+* Using the `IPermissionManager` service (via code)
+
+#### Setting Permissions to Roles and Users via Permission Management Module
+
+When you define a permission, it also becomes usable in the ASP.NET Core authorization system as a **policy name**. If you are using the [Permission Management Module](https://abp.io/docs/latest/modules/permission-management), you can manage the permissions through the UI:
+
+
+
+In the permission management UI, you can grant permissions to roles and users through the **Role Management** and **User Management** pages within the "permissions" modals. You can then easily check these permissions in your code. In the screenshot above, you can see the permission modal for the user's page, clearly showing the permissions granted to the user by their role. (**(R)** in the UI indicates that the permission is granted by one of the current user's roles.)
+
+#### Setting Permissions to Roles and Users via Code
+
+You can also set permissions for roles and users programmatically. You just need to inject the `IPermissionManager` service and use its `SetForRoleAsync` and `SetForUserAsync` methods (or similar methods):
+
+```csharp
+public class MyService : ITransientDependency
+{
+ private readonly IPermissionManager _permissionManager;
+
+ public MyService(IPermissionManager permissionManager)
+ {
+ _permissionManager = permissionManager;
+ }
+
+ public async Task GrantPermissionForUserAsync(Guid userId, string permissionName)
+ {
+ await _permissionManager.SetForUserAsync(userId, permissionName, true);
+ }
+
+ public async Task ProhibitPermissionForUserAsync(Guid userId, string permissionName)
+ {
+ await _permissionManager.SetForUserAsync(userId, permissionName, false);
+ }
+}
+```
+
+### Checking Permissions in AppServices and Controllers
+
+ABP provides multiple ways to check permissions. The most common approach is using the `[Authorize]` attribute and passing the permission/policy name.
+
+Here is an example of how to check permissions in an application service:
+
+```csharp
+[Authorize("BookStore.Books")]
+public class BookAppService : ApplicationService, IBookAppService
+{
+ [Authorize("BookStore.Books.Create")]
+ public async Task CreateAsync(CreateBookDto input)
+ {
+ //logic here
+ }
+}
+```
+
+> Notice that you can use the `[Authorize]` attribute at both class and method levels. In the example above, the `CreateAsync` method is marked with the `[Authorize]` attribute, so it will check the user's permission before executing the method. Since the application service class also has a permission requirement, both permissions must be granted to the user to execute the method!
+
+And here is an example of how to check permissions in a controller:
+
+```csharp
+[Authorize("BookStore.Books")]
+public class CreateBookController : AbpController
+{
+ //omitted for brevity...
+}
+```
+
+### Programmatic Permission Checking
+
+To conditionally control authorization in your code, you can use the `IAuthorizationService` service:
+
+```csharp
+public class BookAppService : ApplicationService, IBookAppService
+{
+ public async Task CreateAsync(CreateBookDto input)
+ {
+ // Checks the permission and throws an exception if the user does not have the permission
+ await AuthorizationService.CheckAsync(BookStorePermissions.Books.Create);
+
+ // Your logic here
+ }
+
+ public async Task CanUserCreateBooksAsync()
+ {
+ // Checks if the permission is granted for the current user
+ return await AuthorizationService.IsGrantedAsync(BookStorePermissions.Books.Create);
+ }
+}
+```
+
+You can use the `IAuthorizationService`'s helpful methods for authorization checking, as shown in the example above:
+
+- `IsGrantedAsync` checks if the current user has the given permission.
+- `CheckAsync` throws an exception if the current user does not have the given permission.
+- `AuthorizeAsync` checks if the current user has the given permission and returns an `AuthorizationResult`, which has a `Succeeded` property that you can use to verify if the user has the permission.
+
+Also notice that we did not inject the `IAuthorizationService` in the constructor, because we are using the `ApplicationService` base class, which already provides property injection for it. This means we can directly use it in our application services, just like other helpful base services (such as `ICurrentUser` and `ICurrentTenant`).
+
+## Conclusion
+
+Permission-based authorization in ABP Framework provides a powerful and flexible approach to securing your applications. By building on ASP.NET Core's policy-based authorization, ABP offers a clean abstraction that simplifies permission management while maintaining the full power of the underlying system.
+
+The ability to check permissions in both application services and controllers makes ABP Framework's authorization system very flexible and powerful, yet easy to use.
+
+Additionally, the Permission Management Module makes it very easy to manage permissions and roles through the UI. You can learn more about how it works in the [documentation](https://abp.io/docs/latest/modules/permission-management).
diff --git a/docs/en/Community-Articles/2025-08-27-Building-a-permission-based-authorization-system-for-net-core/cover-image.png b/docs/en/Community-Articles/2025-08-27-Building-a-permission-based-authorization-system-for-net-core/cover-image.png
new file mode 100644
index 0000000000..f0a0796034
Binary files /dev/null and b/docs/en/Community-Articles/2025-08-27-Building-a-permission-based-authorization-system-for-net-core/cover-image.png differ
diff --git a/docs/en/Community-Articles/2025-08-27-Building-a-permission-based-authorization-system-for-net-core/permission-management-module.png b/docs/en/Community-Articles/2025-08-27-Building-a-permission-based-authorization-system-for-net-core/permission-management-module.png
new file mode 100644
index 0000000000..e22de787af
Binary files /dev/null and b/docs/en/Community-Articles/2025-08-27-Building-a-permission-based-authorization-system-for-net-core/permission-management-module.png differ
diff --git a/docs/en/Community-Articles/2025-08-27-backcompat-rest-apis-ms-dotnet/article.md b/docs/en/Community-Articles/2025-08-27-backcompat-rest-apis-ms-dotnet/article.md
new file mode 100644
index 0000000000..f88bb0e41c
--- /dev/null
+++ b/docs/en/Community-Articles/2025-08-27-backcompat-rest-apis-ms-dotnet/article.md
@@ -0,0 +1,169 @@
+# Best Practices for Designing Backward‑Compatible REST APIs in a Microservice Solution for .NET Developers
+
+## Introduction
+With microservice architecture, each service develops and ships independently at its own pace, and clients infrequently update in lockstep. **Backward compatibility** means that when you release new versions, current consumers continue to function without changing code. This article provides a practical, 6–7 minute tutorial specific to **.NET developers**.
+
+---
+## What Counts as “Breaking”? (and what doesn’t)
+A change is **breaking** if a client that previously conformed can **fail at compile time or runtime**, or exhibit **different business‑critical behavior**, **without** changing that client in any way. In other words: if an old client needs to be altered in order to continue functioning as it did, your change is breaking.
+
+### Examples of breaking changes
+- **Deleting or renaming an endpoint** or modifying its URL/route.
+- **Making an existing field required** (e.g., requiring `address`).
+- **Data type or format changes** (e.g., `price: string` → `price: number`, or date format changes).
+- **Altering default behavior or ordering** that clients implicitly depend on (hidden contracts).
+- **Changing the error model** or HTTP status codes in a manner that breaks pre-existing error handling.
+- **Renaming fields** or **making optional fields required** in requests or responses.
+- **Reinterpreting semantics** (e.g., `status="closed"` formerly included archived items, but no longer does).
+
+### Examples of non‑breaking changes
+- **Optional fields or query parameters can be added** (clients may disregard them).
+- **Adding new enum values** (if the clients default to a safe behavior for unrecognized values).
+- **Adding a new endpoint** while leaving the previous one unchanged.
+- **Performance enhancements** that leave input/output unchanged.
+- **Including metadata** (e.g., pagination links) without changing the current payload shape.
+
+> Golden rule: **Old clients should continue to work exactly as they did before—without any changes.**
+
+---
+## Versioning Strategy
+Versioning is your master control lever for managing change. Typical methods:
+
+1) **URI Segment** (simplest)
+```
+GET /api/v1/orders
+GET /api/v2/orders
+```
+Pros: Cache/gateway‑friendly; explicit in docs. Cons: URL noise.
+
+2) **Header‑Based**
+```
+GET /api/orders
+x-api-version: 2.0
+```
+Pros: Clean URLs; multiple reader support. Cons: Needs proxy/CDN rules.
+
+3) **Media Type**
+ Accept: application/json;v=2
+
+ Pros: Semantically accurate. Cons: More complicated to test and implement. **Recommendation:** For the majority of teams, favor **URI segments**, with an optional **`x-api-version`** header for flexibility.
+
+### Quick Setup in ASP.NET Core (Asp.Versioning)
+```csharp
+// Program.cs
+using Asp.Versioning;
+
+builder.Services.AddControllers();
+builder.Services.AddApiVersioning(o =>
+{
+ o.DefaultApiVersion = new ApiVersion(1, 0);
+ o.AssumeDefaultVersionWhenUnspecified = true;
+ o.ReportApiVersions = true; // response header: api-supported-versions
+ o.ApiVersionReader = ApiVersionReader.Combine(
+ new UrlSegmentApiVersionReader(),
+ new HeaderApiVersionReader("x-api-version")
+ );
+});
+
+builder.Services.AddVersionedApiExplorer(o =>
+{
+ o.GroupNameFormat = "'v'VVV"; // v1, v2
+ o.SubstituteApiVersionInUrl = true;
+});
+```
+```csharp
+// Controller
+using Asp.Versioning;
+
+[ApiController]
+[Route("api/v{version:apiVersion}/orders")]
+public class OrdersController : ControllerBase
+{
+ [HttpGet]
+ [ApiVersion("1.0", Deprecated = true)]
+ public IActionResult GetV1() => Ok(new { message = "v1" });
+
+ [HttpGet]
+ [MapToApiVersion("2.0")]
+ public IActionResult GetV2() => Ok(new { message = "v2", includes = new []{"items"} });
+}
+```
+
+---
+## Schema Evolution Playbook (JSON & DTO)
+Obey the following rules for compatibility‑safe evolution:
+
+- **Add‑only changes**: Favor adding **optional** fields; do not remove/rename fields.
+- **Maintain defaults**: When the new field is disregarded, the old functionality must not change.
+- **Enum extension**: Clients should handle unknown enum values gracefully (default behavior).
+- **Deprecation pipeline**: Mark fields/endpoints as deprecated **at least one version** prior to removal and publicize extensively. - **Stability by contract**: Record any unspoken contracts (ordering, casing, formats) that clients depend on.
+
+### Example: adding a non‑breaking field
+```csharp
+public record OrderDto(
+ Guid Id,
+ decimal Total,
+ string Currency,
+ string? SalesChannel // new, optional
+);
+```
+
+---
+## Compatibility‑Safe API Behaviors
+- **Error model**: Use a standard structure (e.g., RFC 7807 `ProblemDetails`). Avoid ad‑hoc error shapes on a per-endpoint basis.
+- **Versioning/Deprecation communication** through headers:
+- `api-supported-versions: 1.0, 2.0`
+- `Deprecation: true` (in deprecated endpoints)
+- `Sunset: Wed, 01 Oct 2025 00:00:00 GMT` (planned deprecation date)
+- **Idempotency**: Use an `Idempotency-Key` header for retry-safe POSTs.
+- **Optimistic concurrency**: Utilize `ETag`/`If-Match` to prevent lost updates.
+- **Pagination**: Prefer cursor tokens (`nextPageToken`) to protect clients from sorting/index changes.
+- **Time**: Employ ISO‑8601 in UTC; record time‑zone semantics and rounding conventions.
+
+---
+## Rollout & Deprecation Policy
+A good deprecation policy is **announce → coexist → remove**:
+
+1) **Announce**: Release changelog, docs, and comms (mail/Slack) with v2 information and the sunset date.
+2) **Coexist**: Operate v1 and v2 side by side. Employ gateway percentage routing for progressive cutover.
+3) **Observability**: Monitor errors/latency/usage **by version**. When v1 traffic falls below ~5%, plan for removal. 4) **Remove**: Post sunset date, return **410 (Gone)** with a link to migration documentation.
+
+**Canary & Blue‑Green**: Initialize v2 with a small traffic portion and compare error/latency budgets prior to scaling up.
+
+---
+## Contract & Compatibility Testing
+- **Consumer‑Driven Contracts**: Write expectations using Pact.NET; verify at provider CI.
+- **Golden files / snapshots**: Freeze representative JSON payloads and automatically detect regressions.
+- **Version-specific smoke tests**: Maintain separate, minimal test suites for v1 and v2.
+- **SemVer discipline**: Minor = backward‑compatible; Major = breaking (avoid when possible).
+
+Minimal example (xUnit + snapshot style):
+```csharp
+[Fact]
+public async Task Orders_v1_contract_should_match_snapshot()
+{
+ var resp = await _client.GetStringAsync("/api/v1/orders");
+ Approvals.VerifyJson(resp); // snapshot comparison
+}
+```
+
+---
+## Tooling & Docs (for .NET)
+- **Asp.Versioning (NuGet)**: API versioning + ApiExplorer integration.
+- **Swashbuckle / NSwag**: Generate an OpenAPI definition **for every version** (`/swagger/v1/swagger.json`, `/swagger/v2/swagger.json`). Display both in Swagger UI.
+- **Polly**: Client‑side retries/fallbacks to handle transient failures and ensure resilience.
+- **Serilog + OpenTelemetry**: Collect metrics/logs/traces by version for observability and SLOs.
+
+Swagger UI configuration by group name:
+```csharp
+app.UseSwagger();
+app.UseSwaggerUI(c =>
+{
+c.SwaggerEndpoint("/swagger/v1/swagger.json", "API v1");
+c.SwaggerEndpoint("/swagger/v2/swagger.json", "API v2");
+});
+```
+---
+
+## Conclusion
+Backward compatibility is not a version number—it is **disciplined change management**. When you use add‑only schema evolution, a well‑defined versioning strategy, strict contract testing, and rolling rollout, you maintain microservice independence and safeguard consumer experience.
diff --git a/docs/en/Community-Articles/2025-08-27-backcompat-rest-apis-ms-dotnet/cover.png b/docs/en/Community-Articles/2025-08-27-backcompat-rest-apis-ms-dotnet/cover.png
new file mode 100644
index 0000000000..07f0782775
Binary files /dev/null and b/docs/en/Community-Articles/2025-08-27-backcompat-rest-apis-ms-dotnet/cover.png differ
diff --git a/docs/en/Community-Articles/2025-09-02-training-campaign/post.md b/docs/en/Community-Articles/2025-09-02-training-campaign/post.md
new file mode 100644
index 0000000000..821b06de6b
--- /dev/null
+++ b/docs/en/Community-Articles/2025-09-02-training-campaign/post.md
@@ -0,0 +1,29 @@
+# IMPROVE YOUR ABP SKILLS WITH 33% OFF LIVE TRAININGS!
+
+We have exciting news to share\! As you know, we offer live training packages to help you improve your skills and knowledge of ABP. From September 8th to 19th, we are giving you 33% OFF our live trainings, so you can learn more about the product at a discounted price\!
+
+#### Why Join ABP.IO Training?
+
+ABP training programs are designed to help developers, architects, and teams master the ABP Framework efficiently. Whether you're new to the framework or looking to deepen your knowledge, our courses cover everything you need to build robust and scalable applications with ABP.
+
+#### What You’ll Gain:
+
+✔ Comprehensive live training from ABP Experts
+✔ Hands-on learning with real-world applications
+✔ Best practices for building modern web applications
+✔ Certification to showcase your expertise
+
+#### [Limited-Time 33% Discount – Don’t Miss Out\!](https://abp.io/trainings?utm_source=referral&utm_medium=website&utm_campaign=training_abpblogpost)
+
+For a short period, all training packages are available at a 33% discount. This is a great opportunity to upskill yourself or train your team at a significantly reduced cost.
+
+#### How to Get the Discount?
+
+Simply visit our training page, select your preferred package, add your note if needed and send your training request, that's all\! ABP Training Team will reply to your request via email soon.
+
+#### Take Advantage of This Offer Today
+
+Invest in your skills and advance your career with ABP.IO training. This offer won’t last long, so grab your spot now\!
+
+### 🔗[Sign up for training now and start building with ABP](https://abp.io/trainings?utm_source=referral&utm_medium=website&utm_campaign=training_abpblogpost)\!
+
diff --git a/docs/en/Community-Articles/2025-09-03-Keep-Track-of-Your-Users-in-an-ASP.NET-Core-Application/1.png b/docs/en/Community-Articles/2025-09-03-Keep-Track-of-Your-Users-in-an-ASP.NET-Core-Application/1.png
new file mode 100644
index 0000000000..9168907741
Binary files /dev/null and b/docs/en/Community-Articles/2025-09-03-Keep-Track-of-Your-Users-in-an-ASP.NET-Core-Application/1.png differ
diff --git a/docs/en/Community-Articles/2025-09-03-Keep-Track-of-Your-Users-in-an-ASP.NET-Core-Application/2.png b/docs/en/Community-Articles/2025-09-03-Keep-Track-of-Your-Users-in-an-ASP.NET-Core-Application/2.png
new file mode 100644
index 0000000000..ff84b51766
Binary files /dev/null and b/docs/en/Community-Articles/2025-09-03-Keep-Track-of-Your-Users-in-an-ASP.NET-Core-Application/2.png differ
diff --git a/docs/en/Community-Articles/2025-09-03-Keep-Track-of-Your-Users-in-an-ASP.NET-Core-Application/POST.md b/docs/en/Community-Articles/2025-09-03-Keep-Track-of-Your-Users-in-an-ASP.NET-Core-Application/POST.md
new file mode 100644
index 0000000000..076e623ad8
--- /dev/null
+++ b/docs/en/Community-Articles/2025-09-03-Keep-Track-of-Your-Users-in-an-ASP.NET-Core-Application/POST.md
@@ -0,0 +1,335 @@
+# Keep Track of Your Users in an ASP.NET Core Application
+
+Tracking what users do in your app matters for security, debugging, and business insights. Doing it by hand usually means lots of boilerplate: managing request context, logging operations, tracking entity changes, and more. It adds complexity and makes mistakes more likely.
+
+## Why Applications Need Audit Logs
+
+Audit logs are time-ordered records that show what happened in your app.
+
+A good audit log should capture details for every web request, including:
+
+### 1. Request and Response Details
+- Basic info like **URL, HTTP method, browser**, and **HTTP status code**
+- Network info like **client IP address** and **user agent**
+- **Request parameters** and **response content** when needed
+
+### 2. Operations Performed
+- **Controller actions** and **application service method calls** with parameters
+- **Execution time** and **duration** for performance tracking
+- **Call chains** and **dependencies** where helpful
+
+### 3. Entity Changes
+- **Entity changes** that happen during requests
+- **Property-level changes**, with old and new values
+- **Change types** (create, update, delete) and timestamps
+
+### 4. Exception Information
+- **Errors and exceptions** during request execution
+- **Exception stack traces** and **error context**
+- Clear records of failed operations
+
+### 5. Request Duration
+- Key metrics for **measuring performance**
+- **Finding bottlenecks** and optimization opportunities
+- Useful data for **monitoring system health**
+
+## The Challenge with Doing It by Hand
+
+In ASP.NET Core, developers often use middleware or MVC filters for tracking. Here’s what that looks like and the common problems you’ll hit.
+
+### Using Middleware
+
+Middleware are components in the ASP.NET Core pipeline that run during request processing.
+
+Manual tracking typically requires:
+- Writing custom middleware to intercept HTTP requests
+- Extracting user info (user ID, username, IP address, and so on)
+- Recording request start time and execution duration
+- Handling both success and failure cases
+- Saving audit data to logs or a database
+
+### Tracking Inside Business Methods
+
+In your business code, you also need to:
+- Log the start and end of important operations
+- Capture errors and related context
+- Link business operations to the request-level audit data
+- Make sure you track all critical actions
+
+### Problems with Manual Tracking
+
+Manual tracking has some big downsides:
+
+**Code duplication and maintenance pain**: Each controller ends up repeating similar tracking logic. Changing the rules means touching many places, and it’s easy to miss some.
+
+**Consistency and reliability issues**: Different people implement tracking differently. Exception paths are easy to forget. It’s hard to ensure complete coverage.
+
+**Performance and scalability concerns**: Homegrown tracking can slow the app if not designed well. Tuning and extending it takes effort.
+
+**Entity change tracking is especially hard**. It often requires:
+- Recording original values before updates
+- Comparing old and new values for each property
+- Handling complex types, collections, and navigation properties
+- Designing and saving change records
+- Capturing data even when exceptions happen
+
+This usually leads to:
+- **A lot of code** in every update method
+- **Easy-to-miss edge cases** and subtle bugs
+- **High maintenance** when entity models change
+- **Extra queries and comparisons** that can hurt performance
+- **Incomplete coverage** for complex scenarios
+
+## ABP Framework’s Built-in Solution
+
+ABP Framework includes a built-in audit logging system. It solves the problems above and adds useful features on top.
+
+### Simple Setup vs. Manual Tracking
+
+Instead of writing lots of code, you configure it once:
+
+```csharp
+// Configure audit log options in the module's ConfigureServices method
+Configure(options =>
+{
+ options.IsEnabled = true; // Enable audit log system (default value)
+ options.IsEnabledForAnonymousUsers = true; // Track anonymous users (default value)
+ options.IsEnabledForGetRequests = false; // Skip GET requests (default value)
+ options.AlwaysLogOnException = true; // Always log on errors (default value)
+ options.HideErrors = true; // Hide audit log errors (default value)
+ options.EntityHistorySelectors.AddAllEntities(); // Track all entity changes
+});
+```
+
+```csharp
+// Add middleware in the module's OnApplicationInitialization method
+public override void OnApplicationInitialization(ApplicationInitializationContext context)
+{
+ var app = context.GetApplicationBuilder();
+
+ // Add audit log middleware - one line of code solves all problems!
+ app.UseAuditing();
+}
+```
+
+By contrast, manual tracking needs middleware, controller logic, exception handling, and often hundreds of lines. With ABP, a couple of lines enable it and it just works.
+
+## What You Get with ABP
+
+Here’s how ABP removes tracking code from your application and still captures what you need.
+
+### 1. Application Services: No Tracking Code
+
+Manual approach: You’d log inside each method and still risk missing cases.
+
+ABP approach: Tracking is automatic—no tracking code in your methods.
+
+```csharp
+public class BookAppService : ApplicationService
+{
+ private readonly IRepository _bookRepository;
+ private readonly IRepository _authorRepository;
+
+ [Authorize(BookPermissions.Create)]
+ public virtual async Task CreateAsync(CreateBookDto input)
+ {
+ // No need to write any tracking code!
+ // ABP automatically tracks:
+ // - Method calls and parameters
+ // - Calling user
+ // - Execution duration
+ // - Any exceptions thrown
+
+ var author = await _authorRepository.GetAsync(input.AuthorId);
+ var book = new Book(input.Title, author, input.Price);
+
+ await _bookRepository.InsertAsync(book);
+
+ return ObjectMapper.Map(book);
+ }
+
+ [Authorize(BookPermissions.Update)]
+ public virtual async Task UpdateAsync(Guid id, UpdateBookDto input)
+ {
+ var book = await _bookRepository.GetAsync(id);
+
+ // No need to write any entity change tracking code!
+ // ABP automatically tracks entity changes:
+ // - Which properties changed
+ // - Old and new values
+ // - When the change happened
+
+ book.ChangeTitle(input.Title);
+ book.ChangePrice(input.Price);
+
+ await _bookRepository.UpdateAsync(book);
+
+ return ObjectMapper.Map(book);
+ }
+}
+```
+
+With manual code, each method might need 20–30 lines for tracking. With ABP, it’s zero—and you still get richer data.
+
+For entity changes, ABP also saves you from writing comparison code. It handles:
+- Property change detection
+- Recording old and new values
+- Complex types and collections
+- Navigation property changes
+- All with no extra code to maintain
+
+### 2. Entity Change Tracking: One Line to Turn It On
+
+Manual approach: You’d compare properties, serialize complex types, track collection changes, and write to storage.
+
+ABP approach: Mark the entity or select entities globally.
+
+```csharp
+// Enable audit log for specific entity - one line of code solves all problems!
+[Audited]
+public class MyEntity : Entity
+{
+ public string Name { get; set; }
+ public string Description { get; set; }
+
+ [DisableAuditing] // Exclude sensitive data - security control
+ public string InternalNotes { get; set; }
+}
+```
+
+```csharp
+// Or global configuration - batch processing
+Configure(options =>
+{
+ // Track all entities - one line of code tracks all entity changes
+ options.EntityHistorySelectors.AddAllEntities();
+
+ // Or use custom selector - precise control
+ options.EntityHistorySelectors.Add(
+ new NamedTypeSelector(
+ "MySelectorName",
+ type => typeof(IEntity).IsAssignableFrom(type)
+ )
+ );
+});
+```
+
+### 3. Extension Features
+
+Manual approach: Adding custom tracking usually spreads across many places and is hard to test.
+
+ABP approach: Use a contributor for clean, centralized extensions.
+
+```csharp
+public class MyAuditLogContributor : AuditLogContributor
+{
+ public override void PreContribute(AuditLogContributionContext context)
+ {
+ var currentUser = context.ServiceProvider.GetRequiredService();
+
+ // Easily add custom properties - manual implementation needs lots of work
+ context.AuditInfo.SetProperty(
+ "MyCustomClaimValue",
+ currentUser.FindClaimValue("MyCustomClaim")
+ );
+ }
+
+ public override void PostContribute(AuditLogContributionContext context)
+ {
+ // Add custom comments - business logic integration
+ context.AuditInfo.Comments.Add("Some comment...");
+ }
+}
+
+// Register contributor - one line of code enables extension features
+Configure(options =>
+{
+ options.Contributors.Add(new MyAuditLogContributor());
+});
+```
+
+### 4. Precise Control
+
+Manual approach: You end up with complex conditional logic.
+
+ABP approach: Use attributes for simple, precise control.
+
+```csharp
+// Disable audit log for specific controller - precise control
+[DisableAuditing]
+public class HomeController : AbpController
+{
+ // Health check endpoints won't be audited - avoid meaningless logs
+}
+
+// Disable for specific action - method-level control
+public class HomeController : AbpController
+{
+ [DisableAuditing]
+ public async Task Home()
+ {
+ // This action won't be audited - public data access
+ }
+
+ public async Task OtherActionLogged()
+ {
+ // This action will be audited - important business operation
+ }
+}
+```
+
+### 5. Visual Management of Audit Logs
+
+ABP also provides a UI to browse and inspect audit logs:
+
+
+
+
+
+## Manual vs. ABP: A Quick Comparison
+
+The benefits of ABP’s audit log system compared to doing it by hand:
+
+| Aspect | Manual Implementation | ABP Audit Logs |
+|--------|----------------------|----------------|
+| **Setup Complexity** | High — Write middleware, services, repository code | Low — A few lines of config, works out of the box |
+| **Code Maintenance** | High — Tracking code spread across the app | Low — Centralized, convention-based |
+| **Consistency** | Variable — Depends on discipline | Consistent — Automated and standardized |
+| **Performance** | Risky without careful tuning | Built-in optimizations and scope control |
+| **Functionality Completeness** | Basic tracking only | Comprehensive by default |
+| **Error Handling** | Easy to miss edge cases | Automatic and reliable |
+| **Data Integrity** | Manual effort required | Handled by the framework |
+| **Extensibility** | Custom work is costly | Rich extension points |
+| **Development Efficiency** | Weeks to build | Minutes to enable |
+| **Learning Cost** | Understand many details | Convention-based, low effort |
+
+## Why ABP Audit Logs Matter
+
+ABP’s audit logging removes the boilerplate from user tracking in ASP.NET Core apps.
+
+### Core Idea
+
+Manual tracking is error-prone and hard to maintain. ABP gives you a convention-based, automated system that works with minimal setup.
+
+### Key Benefits
+
+ABP runs by convention, so you don’t need repetitive code. You can control behavior at the request, entity, and method levels. It automatically captures request details, operations, entity changes, and exceptions, and you can extend it with contributors when needed.
+
+### Results in Practice
+
+| Metric | Manual Implementation | ABP Implementation | Improvement |
+|--------|----------------------|-------------------|-------------|
+| Development Time | Weeks | Minutes | **99%+** |
+| Lines of Code | Hundreds of lines | 2 lines of config | **99%+** |
+| Maintenance Cost | High | Low | **Significant** |
+| Functionality Completeness | Basic | Comprehensive | **Significant** |
+| Error Rate | Higher risk | Lower risk | **Improved** |
+
+### Recommendation
+
+If you need audit logs, start with ABP’s built-in system. It reduces effort, improves consistency, and stays flexible as your app grows. You can focus on your business logic and let the framework handle the infrastructure.
+
+## References
+
+- [ABP Audit Logging](https://abp.io/docs/latest/framework/infrastructure/audit-logging)
+- [ABP Audit Logging UI](https://abp.io/modules/Volo.AuditLogging.Ui)
diff --git a/docs/en/Community-Articles/2025-09-03-Keep-Track-of-Your-Users-in-an-ASP.NET-Core-Application/cover.png b/docs/en/Community-Articles/2025-09-03-Keep-Track-of-Your-Users-in-an-ASP.NET-Core-Application/cover.png
new file mode 100644
index 0000000000..7030e285b2
Binary files /dev/null and b/docs/en/Community-Articles/2025-09-03-Keep-Track-of-Your-Users-in-an-ASP.NET-Core-Application/cover.png differ
diff --git a/docs/en/cli/index.md b/docs/en/cli/index.md
index 60d4e3ff0b..415cef1878 100644
--- a/docs/en/cli/index.md
+++ b/docs/en/cli/index.md
@@ -33,44 +33,44 @@ While each command may have a set of options, there are some global options that
Here, is the list of all available commands before explaining their details:
-* **`help`**: Shows help on the usage of the ABP CLI.
-* **`cli`**: Update or remove ABP CLI.
-* **`new`**: Generates a new solution based on the ABP [startup templates](../solution-templates/index.md).
-* **`new-module`**: Generates a new module based on the given template.
-* **`new-package`**: Generates a new package based on the given template.
-* **`update`**: Automatically updates all ABP related NuGet and NPM packages in a solution.
-* **`clean`**: Deletes all `BIN` and `OBJ` folders in the current folder.
-* **`add-package`**: Adds an ABP package to a project.
-* **`add-package-ref`**: Adds package to given project.
-* **`install-module`**: Adds a [multi-package application module](../modules/index.md) to a given module.
-* **`install-local-module`**: Installs a local module to given module.
-* **`list-modules`**: Lists names of application modules.
-* **`list-templates`**: Lists the names of available templates to create a solution.
-* **`get-source`**: Downloads the source code of a module.
-* **`add-source-code`**: Downloads the source code and replaces package references with project references.
-* **`init-solution`**: Creates ABP Studio configuration files for a given solution.
-* **`kube-connect`**: Connects to kubernetes environment. (*Available for* ***Business*** *or higher licenses*)
-* **`kube-intercept`**: Intercepts a service running in Kubernetes environment. (*Available for* ***Business*** *or higher licenses*)
-* **`list-module-sources`**: Lists the remote module sources.
-* **`add-module-source`**: Adds a remote module source.
-* **`delete-module-source`**: Deletes a remote module source.
-* **`generate-proxy`**: Generates client side proxies to use HTTP API endpoints.
-* **`remove-proxy`**: Removes previously generated client side proxies.
-* **`switch-to-preview`**: Switches to the latest preview version of the ABP.
-* **`switch-to-nightly`**: Switches to the latest [nightly builds](../release-info/nightly-builds.md) of the ABP related packages on a solution.
-* **`switch-to-stable`**: Switches to the latest stable versions of the ABP related packages on a solution.
-* **`switch-to-local`**: Changes NuGet package references on a solution to local project references.
-* **`upgrade`**: It converts the application to use pro modules.
-* **`translate`**: Simplifies to translate localization files when you have multiple JSON [localization](../framework/fundamentals/localization.md) files in a source control repository.
-* **`login`**: Authenticates on your computer with your [abp.io](https://abp.io/) username and password.
-* **`login-info`**: Shows the current user's login information.
-* **`logout`**: Logouts from your computer if you've authenticated before.
-* **`bundle`**: Generates script and style references for ABP Blazor and MAUI Blazor project.
-* **`install-libs`**: Install NPM Packages for MVC / Razor Pages and Blazor Server UI types.
-* **`clear-download-cache`**: Clears the templates download cache.
-* **`check-extensions`**: Checks the latest version of the ABP CLI extensions.
-* **`install-old-cli`**: Installs old ABP CLI.
-* **`generate-razor-page`**: Generates a page class that you can use it in the ASP NET Core pipeline to return an HTML page.
+* **[`help`](../cli#help)**: Shows help on the usage of the ABP CLI.
+* **[`cli`](../cli#cli)**: Update or remove ABP CLI.
+* **[`new`](../cli#new)**: Generates a new solution based on the ABP [startup templates](../solution-templates/index.md).
+* **[`new-module`](../cli#new-module)**: Generates a new module based on the given template.
+* **[`new-package`](../cli#new-package)**: Generates a new package based on the given template.
+* **[`update`](../cli#update)**: Automatically updates all ABP related NuGet and NPM packages in a solution.
+* **[`clean`](../cli#clean)**: Deletes all `BIN` and `OBJ` folders in the current folder.
+* **[`add-package`](../cli#add-package)**: Adds an ABP package to a project.
+* **[`add-package-ref`](../cli#add-package-ref)**: Adds package to given project.
+* **[`install-module`](../cli#install-module)**: Adds a [multi-package application module](../modules/index.md) to a given module.
+* **[`install-local-module`](../cli#install-local-module)**: Installs a local module to given module.
+* **[`list-modules`](../cli#list-modules)**: Lists names of application modules.
+* **[`list-templates`](../cli#list-templates)**: Lists the names of available templates to create a solution.
+* **[`get-source`](../cli#get-source)**: Downloads the source code of a module.
+* **[`add-source-code`](../cli#add-source-code)**: Downloads the source code and replaces package references with project references.
+* **[`init-solution`](../cli#init-solution)**: Creates ABP Studio configuration files for a given solution.
+* **[`kube-connect`](../cli#kube-connect)**: Connects to kubernetes environment. (*Available for* ***Business*** *or higher licenses*)
+* **[`kube-intercept`](../cli#kube-intercept)**: Intercepts a service running in Kubernetes environment. (*Available for* ***Business*** *or higher licenses*)
+* **[`list-module-sources`](../cli#list-module-sources)**: Lists the remote module sources.
+* **[`add-module-source`](../cli#add-module-source)**: Adds a remote module source.
+* **[`delete-module-source`](../cli#delete-module-source)**: Deletes a remote module source.
+* **[`generate-proxy`](../cli#generate-proxy)**: Generates client side proxies to use HTTP API endpoints.
+* **[`remove-proxy`](../cli#remove-proxy)**: Removes previously generated client side proxies.
+* **[`switch-to-preview`](../cli#switch-to-preview)**: Switches to the latest preview version of the ABP.
+* **[`switch-to-nightly`](../cli#switch-to-nightly)**: Switches to the latest [nightly builds](../release-info/nightly-builds.md) of the ABP related packages on a solution.
+* **[`switch-to-stable`](../cli#switch-to-stable)**: Switches to the latest stable versions of the ABP related packages on a solution.
+* **[`switch-to-local`](../cli#switch-to-local)**: Changes NuGet package references on a solution to local project references.
+* **[`upgrade`](../cli#upgrade)**: It converts the application to use pro modules.
+* **[`translate`](../cli#translate)**: Simplifies to translate localization files when you have multiple JSON [localization](../framework/fundamentals/localization.md) files in a source control repository.
+* **[`login`](../cli#login)**: Authenticates on your computer with your [abp.io](https://abp.io/) username and password.
+* **[`login-info`](../cli#login-info)**: Shows the current user's login information.
+* **[`logout`](../cli#logout)**: Logouts from your computer if you've authenticated before.
+* **[`bundle`](../cli#bundle)**: Generates script and style references for ABP Blazor and MAUI Blazor project.
+* **[`install-libs`](../cli#install-libs)**: Install NPM Packages for MVC / Razor Pages and Blazor Server UI types.
+* **[`clear-download-cache`](../cli#clear-download-cache)**: Clears the templates download cache.
+* **[`check-extensions`](../cli#check-extensions)**: Checks the latest version of the ABP CLI extensions.
+* **[`install-old-cli`](../cli#install-old-cli)**: Installs old ABP CLI.
+* **[`generate-razor-page`](../cli#generate-razor-page)**: Generates a page class that you can use it in the ASP NET Core pipeline to return an HTML page.
### help
diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json
index dc2412b529..585309d8eb 100644
--- a/docs/en/docs-nav.json
+++ b/docs/en/docs-nav.json
@@ -745,6 +745,10 @@
"text": "Image Manipulation",
"path": "framework/infrastructure/image-manipulation.md"
},
+ {
+ "text": "Interceptors",
+ "path": "framework/infrastructure/interceptors.md"
+ },
{
"text": "JSON",
"path": "framework/infrastructure/json.md"
diff --git a/docs/en/dynamic-proxying-interceptors.md b/docs/en/dynamic-proxying-interceptors.md
deleted file mode 100644
index 722eadc249..0000000000
--- a/docs/en/dynamic-proxying-interceptors.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Dynamic Proxying / Interceptors
-
-This document is planned to be written later.
-
-## See Also
-
-* [Video tutorial](https://abp.io/video-courses/essentials/interception)
\ No newline at end of file
diff --git a/docs/en/framework/api-development/standard-apis/configuration.md b/docs/en/framework/api-development/standard-apis/configuration.md
index c1470fcf71..11e754f214 100644
--- a/docs/en/framework/api-development/standard-apis/configuration.md
+++ b/docs/en/framework/api-development/standard-apis/configuration.md
@@ -55,7 +55,16 @@ namespace Acme.BookStore.Web
}
```
+Add your contributor instance to the `AbpApplicationConfigurationOptions`
+
+```csharp
+Configure(options =>
+{
+ options.Contributors.AddIfNotContains(new MyApplicationConfigurationContributor());
+});
+```
+
* `IApplicationConfigurationContributor` defines the `ContributeAsync` method to extend the **application-configuration** endpoint with the specified additional data.
-* You can inject services and perform any logic needed to extend the endpoint as you wish.
+* You can get services from `context.ServiceProvider` and perform any logic needed to extend the endpoint as you wish.
-> Application configuration contributors are automatically discovered by the ABP and executed as a part of the application configuration initialization process.
+> Application configuration contributors are executed as a part of the application configuration initialization process.
diff --git a/docs/en/framework/architecture/domain-driven-design/application-services.md b/docs/en/framework/architecture/domain-driven-design/application-services.md
index 4d32f853dd..968ceb434d 100644
--- a/docs/en/framework/architecture/domain-driven-design/application-services.md
+++ b/docs/en/framework/architecture/domain-driven-design/application-services.md
@@ -134,7 +134,7 @@ The `CreateAsync` method above manually creates a `Book` entity from given `Crea
However, in many cases, it's very practical to use **auto object mapping** to set properties of an object from a similar object. ABP provides an [object to object mapping](../../infrastructure/object-to-object-mapping.md) infrastructure to make this even easier.
-Object to object mapping provides abstractions and it is implemented by the [AutoMapper](https://automapper.org/) library by default.
+Object to object mapping provides abstractions and it is implemented by the [Mapperly](https://mapperly.riok.app/) library by default.
Let's create another method to get a book. First, define the method in the `IBookAppService` interface:
@@ -162,36 +162,32 @@ public class BookDto
}
````
-AutoMapper requires to create a mapping [profile class](https://docs.automapper.org/en/stable/Configuration.html#profile-instances). Example:
+[Mapperly](https://mapperly.riok.app/) requires to create a mapping class that implements the `MapperBase` class with the `[Mapper]` attribute as follows:
-````csharp
-public class MyProfile : Profile
+```csharp
+[Mapper]
+public partial class BookToBookDtoMapper : MapperBase
{
- public MyProfile()
- {
- CreateMap();
- }
+ public override partial BookDto Map(Book source);
+
+ public override partial void Map(Book source, BookDto destination);
}
-````
+```
-You should then register profiles using the `AbpAutoMapperOptions`:
+Then, if your application uses multiple mapping providers, you should add the following configuration to your module's `ConfigureServices` method to decide which mapping provider to use:
````csharp
-[DependsOn(typeof(AbpAutoMapperModule))]
+[DependsOn(typeof(AbpMapperlyModule))]
public class MyModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
- Configure(options =>
- {
- //Add all mappings defined in the assembly of the MyModule class
- options.AddMaps();
- });
+ context.Services.AddMapperlyObjectMapper();
}
}
````
-`AddMaps` registers all profile classes defined in the assembly of the given class, typically your module class. It also registers for the [attribute mapping](https://docs.automapper.org/en/stable/Attribute-mapping.html).
+With this configuration, your module will use [Mapperly](https://mapperly.riok.app/) as the default mapping provider and you don't need to register mapping classes manually.
Then you can implement the `GetAsync` method as shown below:
@@ -291,16 +287,21 @@ public class CreateUpdateBookDto
}
````
-[Profile](https://docs.automapper.org/en/stable/Configuration.html#profile-instances) class of DTO class.
+Define the mapping classes for [Mapperly](https://mapperly.riok.app/) as follows:
```csharp
-public class MyProfile : Profile
+[Mapper]
+public partial class BookToBookDtoMapper : MapperBase
{
- public MyProfile()
- {
- CreateMap();
- CreateMap();
- }
+ public override partial BookDto Map(Book source);
+ public override partial void Map(Book source, BookDto destination);
+}
+
+[Mapper]
+public partial class CreateUpdateBookDtoToBookMapper : MapperBase
+{
+ public override partial Book Map(CreateUpdateBookDto source);
+ public override partial void Map(CreateUpdateBookDto source, Book destination);
}
```
diff --git a/docs/en/framework/infrastructure/entity-cache.md b/docs/en/framework/infrastructure/entity-cache.md
index 64a03ad4c4..cba0cf8eaa 100644
--- a/docs/en/framework/infrastructure/entity-cache.md
+++ b/docs/en/framework/infrastructure/entity-cache.md
@@ -88,6 +88,17 @@ public class MyMapperProfile : Profile
}
```
+If you are using [Mapperly](https://mapperly.riok.app/), you can create a new mapping class that implements the `MapperBase` class with the `[Mapper]` attribute as follows:
+
+```csharp
+[Mapper]
+public partial class ProductToProductDtoMapper : MapperBase
+{
+ public override partial ProductDto Map(Product source);
+ public override partial void Map(Product source, ProductDto destination);
+}
+```
+
Now, you can inject the `IEntityCache` service wherever you want:
```csharp
diff --git a/docs/en/framework/infrastructure/interceptors.md b/docs/en/framework/infrastructure/interceptors.md
new file mode 100644
index 0000000000..d50de3ad84
--- /dev/null
+++ b/docs/en/framework/infrastructure/interceptors.md
@@ -0,0 +1,213 @@
+# Interceptors
+
+ABP provides a powerful interception system that allows you to execute custom logic before and after method calls without modifying the original method code. This is achieved through **dynamic proxying** and is extensively used throughout the ABP framework to implement cross-cutting concerns. ABP's interception is implemented on top of the [Castle DynamicProxy](https://www.castleproject.org/projects/dynamicproxy/) library.
+
+## What is Dynamic Proxying / Interception?
+
+**Interception** is a technique that allows executing additional logic before or after a method call without directly modifying the method's code. This is achieved through **dynamic proxying**, where the runtime generates proxy classes that wrap the original class.
+
+When a method is called on a proxied object:
+1. The call is intercepted by the proxy
+2. Custom behaviors (like logging, validation, or authorization) can be executed
+3. The original method is called
+4. Additional logic can be executed after the method completes
+
+This enables **cross-cutting concerns** (logic that applies across many parts of an application) to be handled in a clean, reusable way without code duplication.
+
+## Similarities and Differences with MVC Action/Page Filters
+
+If you are familiar with ASP.NET Core MVC, you've likely used **action filters** or **page filters**. Interceptors are conceptually similar but have some key differences:
+
+### Similarities
+
+* Both allow executing code before and after method execution
+* Both are used to implement cross-cutting concerns like validation, logging, caching, or exception handling
+* Both support asynchronous operations
+
+### Differences
+
+* **Scope**: Filters are tied to MVC's request pipeline, while interceptors can be applied to **any class or service** in the application
+* **Configuration**: Filters are configured via attributes or middleware in MVC, while interceptors in ABP are applied through **dependency injection and dynamic proxies**
+* **Target**: Interceptors can target application services, domain services, repositories, and virtually any service resolved from the IoC container—not just web controllers
+
+## How ABP Uses Interceptors
+
+ABP Framework extensively leverages interception to provide built-in features without requiring boilerplate code. Here are some key examples:
+
+### [Unit of Work (UOW)](../architecture/domain-driven-design/unit-of-work.md)
+
+Automatically begins and commits/rolls back a database transaction when entering or exiting an application service method. This ensures data consistency without manual transaction management.
+
+### [Input Validation](../fundamentals/validation.md)
+
+Input DTOs are automatically validated against data annotation attributes and custom validation rules before executing the service logic, providing consistent validation behavior across all services.
+
+### [Authorization](../fundamentals/authorization.md)
+
+Checks user permissions before allowing the execution of application service methods, ensuring security policies are enforced consistently.
+
+### [Feature](./features.md) & [Global Feature](./global-features.md) Checking
+
+Checks if a feature is enabled before executing the service logic, allowing you to conditionally enable or restrict functionality for tenants or the application.
+
+### [Auditing](./audit-logging.md)
+
+Automatically logs who performed an action, when it happened, what parameters were used, and what data was involved, providing comprehensive audit trails.
+
+## Building Your Own Interceptor
+
+You can create custom interceptors in ABP to implement your own cross-cutting concerns.
+
+### Creating an Interceptor
+
+Create a class that inherits from `AbpInterceptor`:
+
+````csharp
+using System.Threading.Tasks;
+using Volo.Abp.Aspects;
+using Volo.Abp.DependencyInjection;
+using Volo.Abp.DynamicProxy;
+
+public class ExecutionTimeLogInterceptor : AbpInterceptor, ITransientDependency
+{
+ private readonly ILogger _logger;
+
+ public ExecutionTimeLogInterceptor(ILogger logger)
+ {
+ _logger = logger;
+ }
+
+ public override async Task InterceptAsync(IAbpMethodInvocation invocation)
+ {
+ var sw = Stopwatch.StartNew();
+
+ _logger.LogInformation($"Executing {invocation.TargetObject.GetType().Name}.{invocation.Method.Name}");
+
+ // Proceed to the actual target method
+ await invocation.ProceedAsync();
+
+ sw.Stop();
+
+ _logger.LogInformation($"Executed {invocation.TargetObject.GetType().Name}.{invocation.Method.Name} in {sw.ElapsedMilliseconds} ms");
+ }
+}
+````
+
+### Register Interceptors
+
+Create a static class that contains the `RegisterIfNeeded` method and register the interceptor in the `PreConfigureServices` method of your module.
+
+The `ShouldIntercept` method is used to determine if the interceptor should be registered for the given type. You can add an `IExecutionTimeLogEnabled` interface and implement it in the classes that you want to intercept.
+
+> `DynamicProxyIgnoreTypes` is static class that contains the types that should be ignored by the interceptor. See [Performance Considerations](#performance-considerations) for more information.
+
+````csharp
+// Define an interface to mark the classes that should be intercepted
+public interface IExecutionTimeLogEnabled
+{
+}
+````
+
+````csharp
+using System.Threading.Tasks;
+using Volo.Abp.DependencyInjection;
+
+// A simple service that added to the DI container and will be intercepted since it implements the `IExecutionTimeLogEnabled` interface
+public class SampleExecutionTimeService : IExecutionTimeLogEnabled, ITransientDependency
+{
+ public virtual async Task DoWorkAsync()
+ {
+ // Simulate a long-running task to test the interceptor
+ await Task.Delay(1000);
+ }
+}
+````
+
+````csharp
+using System;
+using Volo.Abp.DependencyInjection;
+using Volo.Abp.DynamicProxy;
+
+public static class ExecutionTimeLogInterceptorRegistrar
+{
+ public static void RegisterIfNeeded(IOnServiceRegistredContext context)
+ {
+ if (ShouldIntercept(context.ImplementationType))
+ {
+ context.Interceptors.TryAdd();
+ }
+ }
+
+ private static bool ShouldIntercept(Type type)
+ {
+ return !DynamicProxyIgnoreTypes.Contains(type) && typeof(IExecutionTimeLogEnabled).IsAssignableFrom(type);
+ }
+}
+````
+
+````csharp
+public override void PreConfigureServices(ServiceConfigurationContext context)
+{
+ context.Services.OnRegistered(ExecutionTimeLogInterceptorRegistrar.RegisterIfNeeded);
+}
+````
+
+## Restrictions and Important Notes
+
+### Always use asynchronous methods
+
+For best performance and reliability, implement your service methods as asynchronous to avoid **async over sync**, that can cause unexpected problems, For more information, see [Should I expose synchronous wrappers for asynchronous methods?](https://devblogs.microsoft.com/dotnet/should-i-expose-synchronous-wrappers-for-asynchronous-methods/)
+
+### Virtual Methods Requirement
+
+For **class proxies**, methods need to be marked as `virtual` so that they can be overridden by the proxy. Otherwise, interception will not occur.
+
+````csharp
+public class MyService : IExecutionTimeLogEnabled, ITransientDependency
+{
+ // This method CANNOT be intercepted (not virtual)
+ public void CannotBeIntercepted()
+ {
+ }
+
+ // This method CAN be intercepted (virtual)
+ public virtual void CanBeIntercepted()
+ {
+ }
+}
+````
+
+> This restriction does **not** apply to interface-based proxies. If your service implements an interface and is injected via that interface, all methods can be intercepted regardless of the `virtual` keyword.
+
+### Dependency Injection Scope
+
+Interceptors only work when services are resolved from the dependency injection container. Direct instantiation with `new` bypasses interception:
+
+````csharp
+// This will NOT be intercepted
+var service = new MyService();
+service.CannotBeIntercepted();
+
+// This WILL be intercepted (if MyService is registered with DI)
+var service = serviceProvider.GetService();
+service.CanBeIntercepted();
+````
+
+### Performance Considerations
+
+Interceptors are generally efficient, but each one adds method-call overhead. Keep the number of interceptors minimal on hot paths.
+
+Castle DynamicProxy can negatively impact performance for certain components, notably ASP.NET Core MVC controllers. See the discussions in [castleproject/Core#486](https://github.com/castleproject/Core/issues/486) and [abpframework/abp#3180](https://github.com/abpframework/abp/issues/3180).
+
+ABP uses interceptors for features like UOW, auditing, and authorization, which rely on dynamic proxy classes. For controllers, prefer implementing cross-cutting concerns with middleware or MVC/Page filters instead of dynamic proxies.
+
+To avoid generating dynamic proxies for specific types, use the static class `DynamicProxyIgnoreTypes` and add the base classes of the types to the list. Subclasses of any listed base class are also ignored. ABP framework already adds some base classes to the list (`ComponentBase, ControllerBase, PageModel, ViewComponent`); you can add more base classes if needed.
+
+> Always use interface-based proxies instead of class-based proxies for better performance.
+
+## See Also
+
+* [Video tutorial: Interceptors in ABP Framework](https://abp.io/video-courses/essentials/interception)
+* [Castle DynamicProxy](https://www.castleproject.org/projects/dynamicproxy/)
+* [Castle.Core.AsyncInterceptor](https://github.com/JSkimming/Castle.Core.AsyncInterceptor)
+* [ASP.NET Core Filters](https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/filters)
diff --git a/docs/en/framework/ui/angular/form-validation.md b/docs/en/framework/ui/angular/form-validation.md
index 6a67018124..6e36945c96 100644
--- a/docs/en/framework/ui/angular/form-validation.md
+++ b/docs/en/framework/ui/angular/form-validation.md
@@ -170,3 +170,211 @@ export const appConfig: ApplicationConfig = {
The error message will be bold and italic now:
+
+## How to Validate Nested Form Groups
+
+There are multiple ways to validate nested form groups in ABP Angular UI. Below is the first and most common approach, using automatic validation and error messages with nested reactive forms. (A second method will be described in the next section.)
+
+### 1st Way: Automatic Validation and Error Message Using Nested Reactive Forms
+
+ABP Angular UI leverages Angular's reactive forms and the [ngx-validate](https://www.npmjs.com/package/@ngx-validate/core) library to provide a robust, flexible, and user-friendly form validation experience. Whether you build your forms manually or use ABP’s dynamic form generation features, validation and error messages are handled automatically.
+
+#### Key Features
+
+- **Automatic Validation:**
+ All validation rules defined in your DTOs (such as `[Required]`, `[StringLength]`, `[EmailAddress]`, etc.) are automatically reflected in the Angular form. Error messages are shown under each field without any extra markup.
+
+- **Nested Form Groups and Dynamic Fields:**
+ For complex data structures, you can group fields or manage dynamic lists using nested `FormGroup` and `FormArray` structures. Validation and error display work seamlessly for both parent and child controls.
+
+- **Dynamic and Extensible Forms:**
+ With ABP’s extensibility system, you can generate forms dynamically using helpers like `generateFormFromProps` and display them with the `abp-extensible-form` component. This ensures all entity properties (including extension properties) are included in the form and their validation rules are applied.
+
+- **No Extra Boilerplate:**
+ You do not need to add custom error components or directives for validation. The system works out of the box, including for nested and dynamically generated controls.
+
+#### Real-World Example: Nested Form Groups in the Users Form
+
+Below is a real example from the Users management form in ABP Angular UI, showing how nested form structures and validation are implemented. This example includes both dynamically generated fields (with `abp-extensible-form`) and a dynamic list of roles using `FormArray` and `FormGroup`.
+
+**TypeScript: Building the Form**
+
+```ts
+buildForm() {
+ const data = new FormPropData(this.injector, this.selected);
+ this.form = generateFormFromProps(data); // Automatically creates form controls from entity and extension properties
+
+ this.service.getAssignableRoles().subscribe(({ items }) => {
+ this.roles = items;
+ if (this.roles) {
+ // Dynamic roles list: nested FormArray and FormGroup
+ this.form.addControl(
+ 'roleNames',
+ this.fb.array(
+ this.roles.map(role =>
+ this.fb.group({
+ [role.name as string]: [
+ this.selected?.id
+ ? !!this.selectedUserRoles?.find(userRole => userRole.id === role.id)
+ : role.isDefault,
+ ],
+ }),
+ ),
+ ),
+ );
+ }
+ });
+}
+```
+
+**HTML: Displaying the Form**
+
+```html
+
+
+
+ }
+
+
+```
+
+**Explanation:**
+- `abp-extensible-form` automatically generates and displays all entity fields and their validation.
+- In the Roles tab, each role is represented by a checkbox, and these checkboxes are managed in a `FormArray`, with each as a `FormGroup`. This is a real-world example of a nested form structure.
+- All validation and error messages are shown automatically for both the main form and nested groups.
+
+
+### 2nd Way: Manual Nested Reactive Forms Without abp-extensible-form
+
+You can also build and validate nested form groups manually, without using `abp-extensible-form` or dynamic helpers. This approach gives you full control over the form structure and is useful for custom or non-entity-based forms.
+
+#### Example: Simple Manual Nested FormGroup
+
+Below is a simple, generic example of a nested reactive form. This form includes a nested `FormGroup` for profile information and demonstrates how to apply validation rules.
+
+**TypeScript: Building the Form**
+
+```ts
+import { Component, OnInit, inject } from '@angular/core';
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import { NgxValidateCoreModule } from '@ngx-validate/core';
+
+@Component({
+ selector: 'app-nested-form',
+ templateUrl: './nested-form.component.html',
+ standalone: true,
+ imports: [NgxValidateCoreModule],
+})
+export class NestedFormComponent implements OnInit {
+ form: FormGroup;
+
+ private fb = inject(FormBuilder);
+
+ ngOnInit() {
+ this.buildForm();
+ }
+
+ buildForm() {
+ this.form = this.fb.group({
+ userName: ['', Validators.required],
+ email: ['', [Validators.required, Validators.email]],
+ profile: this.fb.group({
+ firstName: ['', Validators.required],
+ lastName: ['', Validators.required],
+ }),
+ });
+ }
+
+ submit() {
+ if (this.form.invalid) {
+ return;
+ }
+ // handle submit
+ }
+}
+```
+
+**HTML: Displaying the Form**
+
+```html
+
+```
+
+**How it works:**
+- The form contains main fields (`userName`, `email`) and a nested `FormGroup` (`profile`).
+- The `profile` group includes `firstName` and `lastName` fields, each with their own validation rules.
+- Validation rules are defined directly in the form builder.
+- Error messages and validation feedback are handled automatically by ngx-validate and ABP Angular UI, just like with dynamic forms.
+- This structure ensures that validation works automatically for both the main form and nested groups.
+
+> **Note:** This approach is ideal for custom forms or when you want full control over the form structure. It provides a user experience and validation behavior similar to ABP's dynamic forms, but with manual control over the form layout and logic.
+
+---
\ No newline at end of file
diff --git a/docs/en/modules/cms-kit/index.md b/docs/en/modules/cms-kit/index.md
index 5c30806028..3744ce3590 100644
--- a/docs/en/modules/cms-kit/index.md
+++ b/docs/en/modules/cms-kit/index.md
@@ -72,6 +72,23 @@ CMS kit packages are designed for various usage scenarios. If you check the [CMS
- `Volo.CmsKit.Public.*` packages contain the functionalities used in public websites where users read blog posts or leave comments.
- `Volo.CmsKit.*` (without Admin/Public suffix) packages are called as unified packages. Unified packages are shortcuts for adding Admin & Public packages (of the related layer) separately. If you have a single application for administration and public web site, you can use these packages.
+## Integrating Public and Admin Packages in a Unified Application
+
+If you are using a single application for both admin and public web site, it's important to configure the global layout settings appropriately. By default, the layout is set for a **Public Website**, which is suitable for public-facing pages. However, when your application serves both admin and public pages, you should explicitly set the global layout for all CMS Kit pages.
+
+To do this, add a `_ViewStart.cshtml` file to your web project at `/Pages/Public/CmsKit/_ViewStart.cshtml` and configure the layout as shown below:
+
+```html
+@using Volo.Abp.AspNetCore.Mvc.UI.Theming
+@inject IThemeManager ThemeManager
+@{
+ // default: GetPublicLayout()
+ Layout = ThemeManager.CurrentTheme.GetApplicationLayout();
+}
+```
+
+> The `_ViewStart.cshtml` file is used to set the layout for all pages in the `CmsKit` folder.
+
## Internals
### Table / collection prefix & schema
diff --git a/docs/en/modules/docs.md b/docs/en/modules/docs.md
index b564980ba3..b9c3209e3f 100644
--- a/docs/en/modules/docs.md
+++ b/docs/en/modules/docs.md
@@ -148,11 +148,6 @@ An ABP module must declare `[DependsOn]` attribute if it has a dependency upon a
{
options.DefinitionProviders.Add();
});
-
- Configure(options =>
- {
- options.AddProfile();
- });
}
}
```
diff --git a/docs/en/others/why-abp-platform.md b/docs/en/others/why-abp-platform.md
index c13631546b..61756d2654 100644
--- a/docs/en/others/why-abp-platform.md
+++ b/docs/en/others/why-abp-platform.md
@@ -169,7 +169,7 @@ The learning curve is much lower than not using the ABP. That may sound surprisi
ABP creates a full stack, production-ready, working solution for you in seconds. Many of the real-life problems are already solved and many fine tune configurations are already applied for the ASP.NET Core and the other used libraries. If you start from scratch, you will experience and learn all these details yourself to truly implement your solution.
-ABP uses the industry standard frameworks, libraries and systems you already know (or need to learn to build a real-world product) like Angular, Blazor, MAUI, EF Core, AutoMapper, OpenIddict, Bootstrap, Redis, SignalR... etc. So, all your knowledge is directly re-usable with the ABP. ABP even simplifies using these libraries and systems and solves the integration problems. If you don't know these tools now, learning them will be easier within the ABP.
+ABP uses the industry standard frameworks, libraries and systems you already know (or need to learn to build a real-world product) like Angular, Blazor, MAUI, EF Core, AutoMapper (switched to Mapperly due to licensing concerns), OpenIddict, Bootstrap, Redis, SignalR... etc. So, all your knowledge is directly re-usable with the ABP. ABP even simplifies using these libraries and systems and solves the integration problems. If you don't know these tools now, learning them will be easier within the ABP.
ABP provides an excellent infrastructure to apply DDD principles and other best practices. It provides a lot of sweet abstractions and automation to reduce the repeating code. However, it doesn't force you to use or apply all these. A common mistake is to see that ABP has a lot of features, and it is hard to learn all of them. Having a lot of features is an advantage when you come to the point that you need them. However, you don't need to know a feature until you need it, and you can continue with the development approach you are used to. You can still write code as you are used to as if ABP doesn't provide all these benefits. Learning the ABP infrastructure is progressive. You will love it whenever you learn a new feature but can continue developing without knowing its existence.
diff --git a/docs/en/release-info/migration-guides/pro/openiddict-microservice.md b/docs/en/release-info/migration-guides/pro/openiddict-microservice.md
index 818a8c368a..33c319111b 100644
--- a/docs/en/release-info/migration-guides/pro/openiddict-microservice.md
+++ b/docs/en/release-info/migration-guides/pro/openiddict-microservice.md
@@ -472,17 +472,12 @@ In `appsettings.json` replace **IdentityServer** section with **OpenIddict** and
typeof(AbpOpenIddictProWebModule),
```
-- In **IdentityServiceWebModule.cs** add object mapping configurations:
+- In **IdentityServiceWebModule.cs** add object mapping configurations for [Mapperly](https://mapperly.riok.app/) (if you are using an another mapping providers, see the [Object to Object Mapping](../../../framework/infrastructure/object-to-object-mapping.md) documentation):
```csharp
- context.Services.AddAutoMapperObjectMapper();
- Configure(options =>
- {
- options.AddMaps(validate: true);
- });
+ context.Services.AddMapperlyObjectMapper();
```
-
### Shared Hosting Module
- In **MyApplicationSharedHostingModule** replace the **database configuration**:
diff --git a/docs/en/solution-templates/guide.md b/docs/en/solution-templates/guide.md
index cb14f57ef3..ded0c49f20 100644
--- a/docs/en/solution-templates/guide.md
+++ b/docs/en/solution-templates/guide.md
@@ -27,7 +27,7 @@ Besides the overall solution structure, the internals of each project in a solut
### Library Integrations & Configurations
-When you use ABP startup solution templates to create a new solution, some **fundamental library installations** ([Serilog](https://serilog.net/), [Autofac](https://autofac.org/), [AutoMapper](https://automapper.org/), [Swagger](https://swagger.io/), [HealthCheck](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks) and others..) and their fine-tuned configurations are already prepared for you. Also, required **[ABP packages](https://abp.io/packages)** are just installed based on your preferences and configured for **development and production environments**.
+When you use ABP startup solution templates to create a new solution, some **fundamental library installations** ([Serilog](https://serilog.net/), [Autofac](https://autofac.org/), [Mapperly](https://mapperly.riok.app/), [Swagger](https://swagger.io/), [HealthCheck](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks) and others..) and their fine-tuned configurations are already prepared for you. Also, required **[ABP packages](https://abp.io/packages)** are just installed based on your preferences and configured for **development and production environments**.
### Development Ready
diff --git a/docs/en/tutorials/book-store/part-01.md b/docs/en/tutorials/book-store/part-01.md
index 6b856d9687..4634a68c67 100644
--- a/docs/en/tutorials/book-store/part-01.md
+++ b/docs/en/tutorials/book-store/part-01.md
@@ -291,22 +291,17 @@ public class BookDto : AuditedEntityDto
* The `BookDto` is used to transfer the book data to the presentation layer in order to show the book information on the UI.
* The `BookDto` is derived from the `AuditedEntityDto` which has audit properties just like the `Book` entity defined above.
-It will be needed to map the `Book` entities to the `BookDto` objects while returning books to the presentation layer. [AutoMapper](https://automapper.org) library can automate this conversion when you define the proper mapping. The startup template comes with AutoMapper pre-configured. So, you can just define the mapping in the `BookStoreApplicationAutoMapperProfile` class in the `Acme.BookStore.Application` project:
+It will be needed to map the `Book` entities to the `BookDto` objects while returning books to the presentation layer. [Mapperly](https://mapperly.riok.app/) library can automate this conversion when you define the proper mapping. The startup template comes with Mapperly pre-configured. So, you can just define the mapping in the `BookStoreApplicationMappers` class in the `Acme.BookStore.Application` project:
-````csharp
-using Acme.BookStore.Books;
-using AutoMapper;
-
-namespace Acme.BookStore;
-
-public class BookStoreApplicationAutoMapperProfile : Profile
+```csharp
+[Mapper]
+public partial class BookToBookDtoMapper : MapperBase
{
- public BookStoreApplicationAutoMapperProfile()
- {
- CreateMap();
- }
+ public override partial BookDto Map(Book source);
+
+ public override partial void Map(Book source, BookDto destination);
}
-````
+```
> See the [object to object mapping](../../framework/infrastructure/object-to-object-mapping.md) document for details.
@@ -343,21 +338,23 @@ public class CreateUpdateBookDto
As done to the `BookDto` above, we should define the mapping from the `CreateUpdateBookDto` object to the `Book` entity. The final class will be as shown below:
-````csharp
-using Acme.BookStore.Books;
-using AutoMapper;
+```csharp
+[Mapper]
+public partial class BookToBookDtoMapper : MapperBase
+{
+ public override partial BookDto Map(Book source);
-namespace Acme.BookStore;
+ public override partial void Map(Book source, BookDto destination);
+}
-public class BookStoreApplicationAutoMapperProfile : Profile
+[Mapper]
+public partial class CreateUpdateBookDtoToBookMapper : MapperBase
{
- public BookStoreApplicationAutoMapperProfile()
- {
- CreateMap();
- CreateMap();
- }
+ public override partial Book Map(CreateUpdateBookDto source);
+
+ public override partial void Map(CreateUpdateBookDto source, Book destination);
}
-````
+```
### IBookAppService
@@ -416,7 +413,7 @@ public class BookAppService :
* `BookAppService` is derived from `CrudAppService<...>` which implements all the CRUD (create, read, update, delete) methods defined by the `ICrudAppService`.
* `BookAppService` injects `IRepository` which is the default repository for the `Book` entity. ABP automatically creates default repositories for each aggregate root (or entity). See the [repository document](../../framework/architecture/domain-driven-design/repositories.md).
-* `BookAppService` uses `IObjectMapper` service ([see](../../framework/infrastructure/object-to-object-mapping.md)) to map the `Book` objects to the `BookDto` objects and `CreateUpdateBookDto` objects to the `Book` objects. The Startup template uses the [AutoMapper](http://automapper.org/) library as the object mapping provider. We have defined the mappings before, so it will work as expected.
+* `BookAppService` uses `IObjectMapper` service ([see](../../framework/infrastructure/object-to-object-mapping.md)) to map the `Book` objects to the `BookDto` objects and `CreateUpdateBookDto` objects to the `Book` objects. The Startup template uses the [Mapperly](https://mapperly.riok.app/) library as the object mapping provider. We have defined the mappings before, so it will work as expected.
## Auto API Controllers
diff --git a/docs/en/tutorials/book-store/part-03.md b/docs/en/tutorials/book-store/part-03.md
index 45444ee76f..e67353b1fa 100644
--- a/docs/en/tutorials/book-store/part-03.md
+++ b/docs/en/tutorials/book-store/part-03.md
@@ -298,23 +298,17 @@ public class EditModalModel : BookStorePageModel
### Mapping from BookDto to CreateUpdateBookDto
-To be able to map the `BookDto` to `CreateUpdateBookDto`, configure a new mapping. To do this, open the `BookStoreWebAutoMapperProfile.cs` file in the `Acme.BookStore.Web` project and change it as shown below:
+To be able to map the `BookDto` to `CreateUpdateBookDto`, configure a new mapping. To do this, open the `BookStoreWebMappers.cs` file in the `Acme.BookStore.Web` project and change it as shown below:
-````csharp
-using AutoMapper;
-
-namespace Acme.BookStore.Web;
-
-public class BookStoreWebAutoMapperProfile : Profile
+```csharp
+[Mapper]
+public partial class BookDtoToCreateUpdateBookDtoMapper : MapperBase
{
- public BookStoreWebAutoMapperProfile()
- {
- CreateMap();
- }
-}
-````
+ public override partial CreateUpdateBookDto Map(BookDto source);
-* We have just added `CreateMap();` to define this mapping.
+ public override partial void Map(BookDto source, CreateUpdateBookDto destination);
+}
+```
> Notice that we do the mapping definition in the web layer as a best practice since it is only needed in this layer.
@@ -1288,28 +1282,26 @@ We can now define a modal to edit the book. Add the following code to the end of
````
-### AutoMapper Configuration
+### Mapperly Configuration
The base `AbpCrudPageBase` uses the [object to object mapping](../../framework/infrastructure/object-to-object-mapping.md) system to convert an incoming `BookDto` object to a `CreateUpdateBookDto` object. So, we need to define the mapping.
-Open the `BookStoreBlazorAutoMapperProfile` inside the {{ if UI == "BlazorServer" }}`Acme.BookStore.Blazor` {{ else if UI == "MAUIBlazor" }}`Acme.BookStore.MauiBlazor` {{ else }}`Acme.BookStore.Blazor.Client`{{ end }} project and change the content as the following:
+Open the `BookStoreBlazorMappers` inside the {{ if UI == "BlazorServer" }}`Acme.BookStore.Blazor` {{ else if UI == "MAUIBlazor" }}`Acme.BookStore.MauiBlazor` {{ else }}`Acme.BookStore.Blazor.Client`{{ end }} project and change the content as the following:
-````csharp
-using Acme.BookStore.Books;
-using AutoMapper;
+```csharp
+using Riok.Mapperly.Abstractions;
+using Volo.Abp.Mapperly;
{{ if UI == "BlazorServer" }}namespace Acme.BookStore.Blazor; {{ else if UI == "MAUIBlazor" }}namespace Acme.BookStore.MauiBlazor; {{ else }}namespace Acme.BookStore.Blazor.Client;{{ end }}
-public class BookStoreBlazorAutoMapperProfile : Profile
+[Mapper]
+public partial class BookDtoToCreateUpdateBookDtoMapper : MapperBase
{
- public BookStoreBlazorAutoMapperProfile()
- {
- CreateMap();
- }
-}
-````
+ public override partial CreateUpdateBookDto Map(BookDto source);
-* We've just added the `CreateMap();` line to define the mapping.
+ public override partial void Map(BookDto source, CreateUpdateBookDto destination);
+}
+```
### Test the Editing Modal
diff --git a/docs/en/tutorials/book-store/part-08.md b/docs/en/tutorials/book-store/part-08.md
index a7d73f0209..ac49c6aee4 100644
--- a/docs/en/tutorials/book-store/part-08.md
+++ b/docs/en/tutorials/book-store/part-08.md
@@ -193,7 +193,7 @@ public async Task GetAsync(Guid id)
}
````
-This method simply gets the `Author` entity by its `Id`, converts to the `AuthorDto` using the [object to object mapper](../../framework/infrastructure/object-to-object-mapping.md). This requires to configure the AutoMapper, which will be explained later.
+This method simply gets the `Author` entity by its `Id`, converts to the `AuthorDto` using the [object to object mapper](../../framework/infrastructure/object-to-object-mapping.md). This requires to configure the Mapperly, which will be explained later.
### GetListAsync
@@ -350,12 +350,18 @@ Finally, add the following entries to the `Localization/BookStore/en.json` insid
## Object to Object Mapping
-`AuthorAppService` is using the `ObjectMapper` to convert the `Author` objects to `AuthorDto` objects. So, we need to define this mapping in the AutoMapper configuration.
+`AuthorAppService` is using the `ObjectMapper` to convert the `Author` objects to `AuthorDto` objects. So, we need to define this mapping in the Mapperly configuration.
-Open the `BookStoreApplicationAutoMapperProfile` class inside the `Acme.BookStore.Application` project and add the following line to the constructor:
+Open the `BookStoreApplicationMappers` class inside the `Acme.BookStore.Application` project and define the following mapping class:
````csharp
-CreateMap();
+[Mapper]
+public partial class AuthorToAuthorDtoMapper : MapperBase
+{
+ public override partial AuthorDto Map(Author source);
+
+ public override partial void Map(Author source, AuthorDto destination);
+}
````
## Data Seeder
diff --git a/docs/en/tutorials/book-store/part-09.md b/docs/en/tutorials/book-store/part-09.md
index 06db5f37d9..18ecd2726d 100644
--- a/docs/en/tutorials/book-store/part-09.md
+++ b/docs/en/tutorials/book-store/part-09.md
@@ -335,27 +335,16 @@ The main reason of this decision was to show you how to use a different model cl
* Added `[DataType(DataType.Date)]` attribute to the `BirthDate` which shows a date picker on the UI for this property.
* Added `[TextArea]` attribute to the `ShortBio` which shows a multi-line text area instead of a standard textbox.
-In this way, you can specialize the view model class based on your UI requirements without touching to the DTO. As a result of this decision, we have used `ObjectMapper` to map `CreateAuthorViewModel` to `CreateAuthorDto`. To be able to do that, you need to add a new mapping code to the `BookStoreWebAutoMapperProfile` constructor:
+In this way, you can specialize the view model class based on your UI requirements without touching to the DTO. As a result of this decision, we have used `ObjectMapper` to map `CreateAuthorViewModel` to `CreateAuthorDto`. To be able to do that, you need to define a new mapping configuration in the `BookStoreWebMappers` class:
-````csharp
-using Acme.BookStore.Authors; // ADDED NAMESPACE IMPORT
-using Acme.BookStore.Books;
-using AutoMapper;
-
-namespace Acme.BookStore.Web;
-
-public class BookStoreWebAutoMapperProfile : Profile
+```csharp
+[Mapper]
+public partial class CreateAuthorViewModelToCreateAuthorDtoMapper : MapperBase
{
- public BookStoreWebAutoMapperProfile()
- {
- CreateMap();
-
- // ADD a NEW MAPPING
- CreateMap();
- }
+ public override partial CreateAuthorDto Map(Pages.Authors.CreateModalModel.CreateAuthorViewModel source);
+ public override partial void Map(Pages.Authors.CreateModalModel.CreateAuthorViewModel source, CreateAuthorDto destination);
}
-````
+```
"New author" button will work as expected and open a new model when you run the application again:
@@ -456,29 +445,22 @@ This class is similar to the `CreateModal.cshtml.cs` while there are some main d
* Uses the `IAuthorAppService.GetAsync(...)` method to get the editing author from the application layer.
* `EditAuthorViewModel` has an additional `Id` property which is marked with the `[HiddenInput]` attribute that creates a hidden input for this property.
-This class requires to add two object mapping declarations to the `BookStoreWebAutoMapperProfile` class:
+This class requires to add two object mapping declarations, so open the `BookStoreWebMappers` class and add the following mappings:
```csharp
-using Acme.BookStore.Authors;
-using Acme.BookStore.Books;
-using AutoMapper;
-
-namespace Acme.BookStore.Web;
-
-public class BookStoreWebAutoMapperProfile : Profile
+[Mapper]
+public partial class AuthorDtoToEditAuthorViewModelMapper : MapperBase
{
- public BookStoreWebAutoMapperProfile()
- {
- CreateMap();
+ public override partial EditAuthorViewModel Map(AuthorDto source);
- CreateMap();
+ public override partial void Map(AuthorDto source, EditAuthorViewModel destination);
+}
- // ADD THESE NEW MAPPINGS
- CreateMap();
- CreateMap();
- }
+[Mapper]
+public partial class EditAuthorViewModelToUpdateAuthorDtoMapper : MapperBase
+{
+ public override partial UpdateAuthorDto Map(Pages.Authors.EditModalModel.EditAuthorViewModel source);
+ public override partial void Map(Pages.Authors.EditModalModel.EditAuthorViewModel source, UpdateAuthorDto destination);
}
```
@@ -1220,13 +1202,23 @@ This class typically defines the properties and methods used by the `Authors.raz
`Authors` class uses the `IObjectMapper` in the `OpenEditAuthorModal` method. So, we need to define this mapping.
-Open the `BookStoreBlazorAutoMapperProfile.cs` in the {{ if UI == "BlazorServer" }}`Acme.BookStore.Blazor`{{ else if UI == "MAUIBlazor" }}`Acme.BookStore.MauiBlazor`{{ else }}`Acme.BookStore.Blazor.Client`{{ end }} project and add the following mapping code in the constructor:
+Open the `BookStoreBlazorMappers.cs` in the {{ if UI == "BlazorServer" }}`Acme.BookStore.Blazor`{{ else if UI == "MAUIBlazor" }}`Acme.BookStore.MauiBlazor`{{ else }}`Acme.BookStore.Blazor.Client`{{ end }} project and add the following mappings in the class:
-````csharp
-CreateMap();
-````
+```csharp
+using Riok.Mapperly.Abstractions;
+using Volo.Abp.Mapperly;
+using Acme.BookStore.Authors;
+
+//...
+
+[Mapper]
+public partial class AuthorDtoToUpdateAuthorDtoMapper : MapperBase
+{
+ public override partial UpdateAuthorDto Map(AuthorDto source);
-You will need to declare a `using Acme.BookStore.Authors;` statement to the beginning of the file.
+ public override partial void Map(AuthorDto source, UpdateAuthorDto destination);
+}
+```
### Add to the Main Menu
diff --git a/docs/en/tutorials/book-store/part-10.md b/docs/en/tutorials/book-store/part-10.md
index d4137e3681..02d1f81aba 100644
--- a/docs/en/tutorials/book-store/part-10.md
+++ b/docs/en/tutorials/book-store/part-10.md
@@ -578,11 +578,17 @@ Let's see the changes we've done:
### Object to Object Mapping Configuration
-Introduced the `AuthorLookupDto` class and used object mapping inside the `GetAuthorLookupAsync` method. So, we need to add a new mapping definition inside the `BookStoreApplicationAutoMapperProfile.cs` file of the `Acme.BookStore.Application` project:
+Introduced the `AuthorLookupDto` class and used object mapping inside the `GetAuthorLookupAsync` method. So, we need to add a new mapping definition inside the `BookStoreApplicationMappers.cs` file of the `Acme.BookStore.Application` project:
-````csharp
-CreateMap();
-````
+```csharp
+[Mapper]
+public partial class AuthorToAuthorLookupDtoMapper : MapperBase
+{
+ public override partial AuthorLookupDto Map(Author source);
+
+ public override partial void Map(Author source, AuthorLookupDto destination);
+}
+```
## Unit Tests
@@ -898,12 +904,37 @@ These changes require a small change in the `EditModal.cshtml`. Remove the `();
-CreateMap();
-CreateMap();
+using Riok.Mapperly.Abstractions;
+using Volo.Abp.Mapperly;
+
+//...
+
+[Mapper]
+public partial class CreateBookViewModelToCreateUpdateBookDtoMapper : MapperBase
+{
+ public override partial CreateUpdateBookDto Map(Pages.Books.CreateModalModel.CreateBookViewModel source);
+
+ public override partial void Map(Pages.Books.CreateModalModel.CreateBookViewModel source, CreateUpdateBookDto destination);
+}
+
+[Mapper]
+public partial class BookDtoToEditBookViewModelMapper : MapperBase
+{
+ public override partial Pages.Books.EditModalModel.EditBookViewModel Map(BookDto source);
+
+ public override partial void Map(BookDto source, Pages.Books.EditModalModel.EditBookViewModel destination);
+}
+
+[Mapper]
+public partial class EditBookViewModelToCreateUpdateBookDtoMapper : MapperBase
+{
+ public override partial CreateUpdateBookDto Map(Pages.Books.EditModalModel.EditBookViewModel source);
+
+ public override partial void Map(Pages.Books.EditModalModel.EditBookViewModel source, CreateUpdateBookDto destination);
+}
```
You can run the application and try to create a new book or update an existing book. You will see a drop down list on the create/update form to select the author of the book:
diff --git a/docs/en/tutorials/microservice/part-05.md b/docs/en/tutorials/microservice/part-05.md
index 9c037617a1..e72e94fc66 100644
--- a/docs/en/tutorials/microservice/part-05.md
+++ b/docs/en/tutorials/microservice/part-05.md
@@ -255,21 +255,20 @@ public class OrderAppService : ApplicationService, IOrderAppService
In this code snippet, we inject the `IRepository` into the `OrderAppService` class. We use this repository to interact with the `Order` entity. The `GetListAsync` method retrieves a list of orders from the database and maps them to the `OrderDto` class. The `CreateAsync` method creates a new order entity and inserts it into the database.
-Afterward, we need to configure the *AutoMapper* object to map the `Order` entity to the `OrderDto` class. Open the `OrderingServiceApplicationAutoMapperProfile` class in the `CloudCrm.OrderingService` project, located in the `ObjectMapping` folder, and add the following code:
+Afterward, we need to configure the *Mapperly* object to map the `Order` entity to the `OrderDto` class. Open the `OrderingServiceApplicationMappers` class in the `CloudCrm.OrderingService` project, located in the `ObjectMapping` folder, and add the following code:
```csharp
-using AutoMapper;
-using CloudCrm.OrderingService.Entities;
-using CloudCrm.OrderingService.Services;
+using Riok.Mapperly.Abstractions;
+using Volo.Abp.Mapperly;
namespace CloudCrm.OrderingService.ObjectMapping;
-public class OrderingServiceApplicationAutoMapperProfile : Profile
+[Mapper]
+public partial class OrderingServiceApplicationMappers : MapperBase
{
- public OrderingServiceApplicationAutoMapperProfile()
- {
- CreateMap();
- }
+ public override partial OrderDto Map(Order source);
+
+ public override partial void Map(Order source, OrderDto destination);
}
```
diff --git a/docs/en/tutorials/microservice/part-06.md b/docs/en/tutorials/microservice/part-06.md
index e5a8f53fe5..f268ba6fff 100644
--- a/docs/en/tutorials/microservice/part-06.md
+++ b/docs/en/tutorials/microservice/part-06.md
@@ -216,25 +216,25 @@ public class OrderDto
}
```
-Lastly, open the `OrderingServiceApplicationAutoMapperProfile` class (the `OrderingServiceApplicationAutoMapperProfile.cs` file under the `ObjectMapping` folder of the `CloudCrm.OrderingService` project of the `CloudCrm.OrderingService` .NET solution) and ignore the `ProductName` property in the mapping configuration:
+Lastly, open the `OrderingServiceApplicationMappers` class (the `OrderingServiceApplicationMappers.cs` file under the `ObjectMapping` folder of the `CloudCrm.OrderingService` project of the `CloudCrm.OrderingService` .NET solution) and ignore the `ProductName` property in the mapping configuration:
```csharp
-using AutoMapper;
-using CloudCrm.OrderingService.Entities;
-using CloudCrm.OrderingService.Services;
-using Volo.Abp.AutoMapper;
+using Riok.Mapperly.Abstractions;
+using Volo.Abp.Mapperly;
namespace CloudCrm.OrderingService.ObjectMapping;
-public class OrderingServiceApplicationAutoMapperProfile : Profile
+[Mapper]
+public partial class OrderingServiceApplicationMappers : MapperBase
{
- public OrderingServiceApplicationAutoMapperProfile()
- {
- CreateMap()
- .Ignore(x => x.ProductName); // New line
- }
+ [MapperIgnoreTarget(nameof(OrderDto.ProductName))]
+ public override partial OrderDto Map(Order source);
+
+ [MapperIgnoreTarget(nameof(OrderDto.ProductName))]
+ public override partial void Map(Order source, OrderDto destination);
}
```
+
Let's explain the changes we made:
- We added a new property named `ProductName` to the `OrderDto` class. This property will hold the product name.
diff --git a/docs/en/tutorials/modular-crm/part-03.md b/docs/en/tutorials/modular-crm/part-03.md
index fb19277895..bbb0339b50 100644
--- a/docs/en/tutorials/modular-crm/part-03.md
+++ b/docs/en/tutorials/modular-crm/part-03.md
@@ -323,23 +323,17 @@ Notice that `ProductAppService` class implements the `IProductAppService` and al
#### Object Mapping
-`ProductAppService.GetListAsync` method uses the `ObjectMapper` service to convert `Product` entities to `ProductDto` objects. The mapping should be configured. Open the `CatalogAutoMapperProfile` class in the `ModularCrm.Catalog` project and change it to the following code block:
+`ProductAppService.GetListAsync` method uses the `ObjectMapper` service to convert `Product` entities to `ProductDto` objects. The mapping should be configured. So, create a new mapping class in the `ModularCrm.Catalog` project that implements the `MapperBase` class with the `[Mapper]` attribute as follows:
-````csharp
-using AutoMapper;
-
-namespace ModularCrm.Catalog;
-
-public class CatalogAutoMapperProfile : Profile
+```csharp
+[Mapper]
+public partial class ProductToProductDtoMapper : MapperBase
{
- public CatalogAutoMapperProfile()
- {
- CreateMap();
- }
-}
-````
+ public override partial ProductDto Map(Product source);
-We've added the `CreateMap();` line to define the mapping.
+ public override partial void Map(Product source, ProductDto destination);
+}
+```
### Exposing Application Services as HTTP API Controllers
diff --git a/docs/en/tutorials/modular-crm/part-05.md b/docs/en/tutorials/modular-crm/part-05.md
index d2082667aa..46a693a963 100644
--- a/docs/en/tutorials/modular-crm/part-05.md
+++ b/docs/en/tutorials/modular-crm/part-05.md
@@ -283,21 +283,17 @@ The new files under the `ModularCrm.Ordering.Contracts` project should be like t
### Implementing the Application Service
-First we configure the *AutoMapper* to map the `Order` entity to the `OrderDto` object, because we will need it later. Open the `OrderingAutoMapperProfile` under the `ModularCrm.Ordering` project:
+First, create a new mapping class (under the `ModularCrm.Ordering` project) that implements the `MapperBase` class with the `[Mapper]` attribute to map `Order` entities to `OrderDto` objects as follows, because we will need it later:
-````csharp
-using AutoMapper;
-
-namespace ModularCrm.Ordering;
-
-public class OrderingAutoMapperProfile : Profile
+```csharp
+[Mapper]
+public partial class OrderToOrderDtoMapper : MapperBase
{
- public OrderingAutoMapperProfile()
- {
- CreateMap();
- }
+ public override partial OrderDto Map(Order source);
+
+ public override partial void Map(Order source, OrderDto destination);
}
-````
+```
Now, you can implement the `IOrderAppService` interface. Create an `OrderAppService` class under the `ModularCrm.Ordering` project:
diff --git a/docs/en/tutorials/modular-crm/part-06.md b/docs/en/tutorials/modular-crm/part-06.md
index b685d72960..1c04cd56d1 100644
--- a/docs/en/tutorials/modular-crm/part-06.md
+++ b/docs/en/tutorials/modular-crm/part-06.md
@@ -217,21 +217,17 @@ public class OrderDto
}
````
-Lastly, open the `OrderingAutoMapperProfile` class (the `OrderingAutoMapperProfile.cs` file under the `Services` folder of the `ModularCrm.Ordering` project of the `ModularCrm.Ordering` .NET solution) and ignore the `ProductName` property in the mapping configuration:
+Lastly, open the `OrderingApplicationMappers` class (the `OrderingApplicationMappers.cs` file under the `Services` folder of the `ModularCrm.Ordering` project of the `ModularCrm.Ordering` .NET solution) and add the following mapping class:
````csharp
-using AutoMapper;
-using Volo.Abp.AutoMapper;
-
-namespace ModularCrm.Ordering;
-
-public class OrderingApplicationAutoMapperProfile : Profile
+[Mapper]
+public partial class OrderToOrderDtoMapper : MapperBase
{
- public OrderingApplicationAutoMapperProfile()
- {
- CreateMap()
- .Ignore(x => x.ProductName); // New line
- }
+ [MapperIgnoreTarget(nameof(OrderDto.ProductName))]
+ public override partial OrderDto Map(Order source);
+
+ [MapperIgnoreTarget(nameof(OrderDto.ProductName))]
+ public override partial void Map(Order source, OrderDto destination);
}
````
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/TelemetryApplicationMetricsEnricher.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/TelemetryApplicationMetricsEnricher.cs
new file mode 100644
index 0000000000..fa95f5c298
--- /dev/null
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/TelemetryApplicationMetricsEnricher.cs
@@ -0,0 +1,47 @@
+using System;
+using System.Threading.Tasks;
+using Volo.Abp.Application.Services;
+using Volo.Abp.DependencyInjection;
+using System.Linq;
+using Microsoft.AspNetCore.Mvc;
+using Volo.Abp.Internal.Telemetry.Activity;
+using Volo.Abp.Internal.Telemetry.Activity.Contracts;
+using Volo.Abp.Internal.Telemetry.Activity.Providers;
+using Volo.Abp.Internal.Telemetry.Constants;
+using Volo.Abp.Internal.Telemetry.Constants.Enums;
+using Volo.Abp.Reflection;
+
+namespace Volo.Abp.AspNetCore.Mvc;
+
+[ExposeServices(typeof(ITelemetryActivityEventEnricher), typeof(IHasParentTelemetryActivityEventEnricher))]
+public sealed class TelemetryApplicationMetricsEnricher : TelemetryActivityEventEnricher, IHasParentTelemetryActivityEventEnricher
+{
+ private readonly ITypeFinder _typeFinder;
+ public TelemetryApplicationMetricsEnricher(ITypeFinder typeFinder, IServiceProvider serviceProvider) : base(serviceProvider)
+ {
+ _typeFinder = typeFinder;
+ }
+
+ protected override Task CanExecuteAsync(ActivityContext context)
+ {
+ return Task.FromResult(context.SessionType == SessionType.ApplicationRuntime);
+ }
+
+ protected override Task ExecuteAsync(ActivityContext context)
+ {
+ var appServiceCount = _typeFinder.Types.Count(t =>
+ typeof(IApplicationService).IsAssignableFrom(t) &&
+ t is { IsAbstract: false, IsInterface: false } &&
+ !t.AssemblyQualifiedName!.StartsWith(TelemetryConsts.VoloNameSpaceFilter));
+
+ var controllerCount = _typeFinder.Types.Count(t =>
+ typeof(ControllerBase).IsAssignableFrom(t) &&
+ !t.IsAbstract &&
+ !t.AssemblyQualifiedName!.StartsWith(TelemetryConsts.VoloNameSpaceFilter));
+
+
+ context.Current[ActivityPropertyNames.AppServiceCount] = appServiceCount;
+ context.Current[ActivityPropertyNames.ControllerCount] = controllerCount;
+ return Task.CompletedTask;
+ }
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.Authorization.Abstractions/Properties/AssemblyInfo.cs b/framework/src/Volo.Abp.Authorization.Abstractions/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000000..f9e35084b9
--- /dev/null
+++ b/framework/src/Volo.Abp.Authorization.Abstractions/Properties/AssemblyInfo.cs
@@ -0,0 +1,20 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Volo.Abp.Authorization.Abstractions")]
+[assembly: AssemblyTrademark("")]
+[assembly: InternalsVisibleTo("Volo.Abp.Authorization")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("83632bec-2f60-4c2b-b964-30e8b37fa9d8")]
diff --git a/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionDefinition.cs b/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionDefinition.cs
index ab49e4aad4..0f5d713e2b 100644
--- a/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionDefinition.cs
+++ b/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionDefinition.cs
@@ -108,6 +108,8 @@ public class PermissionDefinition :
Parent = this
};
+ child[PermissionDefinitionContext.KnownPropertyNames.CurrentProviderName] = this[PermissionDefinitionContext.KnownPropertyNames.CurrentProviderName];
+
_children.Add(child);
return child;
diff --git a/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionDefinitionContext.cs b/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionDefinitionContext.cs
index 85d771a6ab..394cdb9d82 100644
--- a/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionDefinitionContext.cs
+++ b/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionDefinitionContext.cs
@@ -11,6 +11,13 @@ public class PermissionDefinitionContext : IPermissionDefinitionContext
public Dictionary Groups { get; }
+ internal IPermissionDefinitionProvider? CurrentProvider { get; set; }
+
+ public static class KnownPropertyNames
+ {
+ public const string CurrentProviderName = "_CurrentProviderName";
+ }
+
public PermissionDefinitionContext(IServiceProvider serviceProvider)
{
ServiceProvider = serviceProvider;
@@ -28,7 +35,16 @@ public class PermissionDefinitionContext : IPermissionDefinitionContext
throw new AbpException($"There is already an existing permission group with name: {name}");
}
- return Groups[name] = new PermissionGroupDefinition(name, displayName);
+ var group = new PermissionGroupDefinition(name, displayName);
+
+ if (CurrentProvider != null)
+ {
+ group[KnownPropertyNames.CurrentProviderName] = CurrentProvider.GetType().FullName;
+ }
+
+ Groups[name] = group;
+
+ return group;
}
[NotNull]
diff --git a/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionGroupDefinition.cs b/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionGroupDefinition.cs
index bbc6e96cdf..0ad2dca099 100644
--- a/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionGroupDefinition.cs
+++ b/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionGroupDefinition.cs
@@ -61,6 +61,8 @@ public class PermissionGroupDefinition : ICanAddChildPermission
isEnabled
);
+ permission[PermissionDefinitionContext.KnownPropertyNames.CurrentProviderName] = this[PermissionDefinitionContext.KnownPropertyNames.CurrentProviderName];
+
_permissions.Add(permission);
return permission;
diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/StaticPermissionDefinitionStore.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/StaticPermissionDefinitionStore.cs
index 2d0a9d668c..4e6ff0d11c 100644
--- a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/StaticPermissionDefinitionStore.cs
+++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/StaticPermissionDefinitionStore.cs
@@ -84,18 +84,23 @@ public class StaticPermissionDefinitionStore : IStaticPermissionDefinitionStore,
foreach (var provider in providers)
{
+ context.CurrentProvider = provider;
provider.PreDefine(context);
}
foreach (var provider in providers)
{
+ context.CurrentProvider = provider;
provider.Define(context);
}
foreach (var provider in providers)
{
+ context.CurrentProvider = provider;
provider.PostDefine(context);
}
+
+ context.CurrentProvider = null;
return context.Groups;
}
diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/TelemetryPermissionInfoEnricher.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/TelemetryPermissionInfoEnricher.cs
new file mode 100644
index 0000000000..4fab06ba8f
--- /dev/null
+++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/TelemetryPermissionInfoEnricher.cs
@@ -0,0 +1,45 @@
+using System;
+using System.Linq;
+using System.Threading.Tasks;
+using Volo.Abp.DependencyInjection;
+using Volo.Abp.Internal.Telemetry.Activity;
+using Volo.Abp.Internal.Telemetry.Activity.Contracts;
+using Volo.Abp.Internal.Telemetry.Activity.Providers;
+using Volo.Abp.Internal.Telemetry.Constants;
+
+namespace Volo.Abp.Authorization.Permissions;
+
+[ExposeServices(typeof(ITelemetryActivityEventEnricher), typeof(IHasParentTelemetryActivityEventEnricher))]
+public sealed class TelemetryPermissionInfoEnricher : TelemetryActivityEventEnricher, IHasParentTelemetryActivityEventEnricher
+{
+ private readonly IPermissionDefinitionManager _permissionDefinitionManager;
+
+ public TelemetryPermissionInfoEnricher(IPermissionDefinitionManager permissionDefinitionManager,
+ IServiceProvider serviceProvider) : base(serviceProvider)
+ {
+ _permissionDefinitionManager = permissionDefinitionManager;
+ }
+
+ protected override Task CanExecuteAsync(ActivityContext context)
+ {
+ return Task.FromResult(context.ProjectId.HasValue);
+ }
+
+ protected async override Task ExecuteAsync(ActivityContext context)
+ {
+ var permissions = await _permissionDefinitionManager.GetPermissionsAsync();
+
+ var userDefinedPermissionsCount = permissions.Count(IsUserDefinedPermission);
+
+ context.Current[ActivityPropertyNames.PermissionCount] = userDefinedPermissionsCount;
+ }
+
+ private static bool IsUserDefinedPermission(PermissionDefinition permission)
+ {
+ return permission.Properties.TryGetValue(PermissionDefinitionContext.KnownPropertyNames.CurrentProviderName, out var providerName) &&
+ providerName is string &&
+ !providerName.ToString()!.StartsWith(TelemetryConsts.VoloNameSpaceFilter);
+ }
+
+
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.Core/Volo.Abp.Core.csproj b/framework/src/Volo.Abp.Core/Volo.Abp.Core.csproj
index dd42cdee32..def4aa417d 100644
--- a/framework/src/Volo.Abp.Core/Volo.Abp.Core.csproj
+++ b/framework/src/Volo.Abp.Core/Volo.Abp.Core.csproj
@@ -22,6 +22,7 @@
+
diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationBase.cs b/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationBase.cs
index ec20467ac9..6811e2a9a1 100644
--- a/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationBase.cs
+++ b/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationBase.cs
@@ -4,13 +4,17 @@ using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using JetBrains.Annotations;
+using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Internal;
+using Volo.Abp.Internal.Telemetry;
+using Volo.Abp.Internal.Telemetry.Constants;
using Volo.Abp.Logging;
using Volo.Abp.Modularity;
+using Volo.Abp.Threading;
namespace Volo.Abp;
@@ -149,6 +153,56 @@ public abstract class AbpApplicationBase : IAbpApplication
options.PlugInSources
);
}
+ protected void SetupTelemetryTracking()
+ {
+ if (!ShouldSendTelemetryData())
+ {
+ return;
+ }
+
+ AsyncHelper.RunSync(InitializeTelemetryTracking);
+ }
+
+ protected async Task SetupTelemetryTrackingAsync()
+ {
+ if (!ShouldSendTelemetryData())
+ {
+ return;
+ }
+
+ await InitializeTelemetryTracking();
+ }
+
+ private async Task InitializeTelemetryTracking()
+ {
+ try
+ {
+ using var scope = ServiceProvider.CreateScope();
+ var telemetryService = scope.ServiceProvider.GetRequiredService();
+ await telemetryService.AddActivityAsync(ActivityNameConsts.ApplicationRun);
+ }
+ catch (Exception ex)
+ {
+ try
+ {
+ using var scope = ServiceProvider.CreateScope();
+ var logger = scope.ServiceProvider.GetRequiredService>();
+ logger.LogException(ex, LogLevel.Trace);
+ }
+ catch
+ {
+ /* ignored */
+ }
+ }
+ }
+
+ private bool ShouldSendTelemetryData()
+ {
+ using var scope = ServiceProvider.CreateScope();
+ var abpHostEnvironment = scope.ServiceProvider.GetRequiredService();
+ var configuration = scope.ServiceProvider.GetRequiredService();
+ return abpHostEnvironment.IsDevelopment() && configuration.GetValue("Abp:Telemetry:IsEnabled") == true;
+ }
//TODO: We can extract a new class for this
public virtual async Task ConfigureServicesAsync()
diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationWithExternalServiceProvider.cs b/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationWithExternalServiceProvider.cs
index d80e46c5d7..faf4f7fa1a 100644
--- a/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationWithExternalServiceProvider.cs
+++ b/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationWithExternalServiceProvider.cs
@@ -44,6 +44,8 @@ internal class AbpApplicationWithExternalServiceProvider : AbpApplicationBase, I
SetServiceProvider(serviceProvider);
await InitializeModulesAsync();
+
+ await SetupTelemetryTrackingAsync();
}
public void Initialize([NotNull] IServiceProvider serviceProvider)
@@ -53,6 +55,8 @@ internal class AbpApplicationWithExternalServiceProvider : AbpApplicationBase, I
SetServiceProvider(serviceProvider);
InitializeModules();
+
+ SetupTelemetryTracking();
}
public override void Dispose()
diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationWithInternalServiceProvider.cs b/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationWithInternalServiceProvider.cs
index c5e5eccc83..b652999a7a 100644
--- a/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationWithInternalServiceProvider.cs
+++ b/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationWithInternalServiceProvider.cs
@@ -50,12 +50,15 @@ internal class AbpApplicationWithInternalServiceProvider : AbpApplicationBase, I
{
CreateServiceProvider();
await InitializeModulesAsync();
+ await SetupTelemetryTrackingAsync();
+
}
public void Initialize()
{
CreateServiceProvider();
InitializeModules();
+ SetupTelemetryTracking();
}
public override void Dispose()
diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/ConventionalRegistrarBase.cs b/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/ConventionalRegistrarBase.cs
index d9fae16e16..0f83fcced7 100644
--- a/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/ConventionalRegistrarBase.cs
+++ b/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/ConventionalRegistrarBase.cs
@@ -19,16 +19,15 @@ public abstract class ConventionalRegistrarBase : IConventionalRegistrar
{
types = AssemblyHelper
.GetAllTypes(assembly)
- .Where(
- type => type != null &&
- type.IsClass &&
- !type.IsAbstract &&
- !type.IsGenericType
- ).ToArray();
+ .Where(type => type != null && type.IsClass && !type.IsAbstract && !type.IsGenericType)
+ .ToArray();
}
catch (ReflectionTypeLoadException e)
{
- types = e.Types.Select(x => x!).ToArray();
+ types = e.Types
+ .Where(type => type != null && type.IsClass && !type.IsAbstract && !type.IsGenericType)
+ .Select(x => x!)
+ .ToArray();
logger.LogException(e);
}
catch (Exception e)
diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/ActivityContext.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/ActivityContext.cs
new file mode 100644
index 0000000000..8a03a66e65
--- /dev/null
+++ b/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/ActivityContext.cs
@@ -0,0 +1,50 @@
+using System;
+using System.Collections.Generic;
+using Volo.Abp.Internal.Telemetry.Constants;
+using Volo.Abp.Internal.Telemetry.Constants.Enums;
+
+namespace Volo.Abp.Internal.Telemetry.Activity;
+
+public class ActivityContext
+{
+ public ActivityEvent Current { get; }
+ public Dictionary ExtraProperties { get; } = new();
+ public bool IsTerminated { get; private set; }
+
+ public Guid? ProjectId => Current.Get(ActivityPropertyNames.ProjectId);
+
+ public Guid? SolutionId => Current.Get(ActivityPropertyNames.SolutionId);
+
+ public SessionType? SessionType => Current.Get(ActivityPropertyNames.SessionType);
+
+ public string? DeviceId => Current.Get(ActivityPropertyNames.DeviceId);
+
+ public string? SolutionPath => ExtraProperties.TryGetValue(ActivityPropertyNames.SolutionPath, out var solutionPath)
+ ? solutionPath?.ToString()
+ : null;
+
+ private ActivityContext(ActivityEvent current)
+ {
+ Current = current;
+ }
+
+ public static ActivityContext Create(string activityName, string? details = null,
+ Action>? additionalProperties = null)
+ {
+ var activity = new ActivityEvent(activityName, details);
+
+ if (additionalProperties is not null)
+ {
+ var additionalPropertiesDict = new Dictionary();
+ activity[ActivityPropertyNames.AdditionalProperties] = additionalPropertiesDict;
+ additionalProperties.Invoke(additionalPropertiesDict);
+ }
+
+ return new ActivityContext(activity);
+ }
+
+ public void Terminate()
+ {
+ IsTerminated = true;
+ }
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/ActivityEvent.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/ActivityEvent.cs
new file mode 100644
index 0000000000..22ad4c0da3
--- /dev/null
+++ b/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/ActivityEvent.cs
@@ -0,0 +1,147 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.Json;
+using Volo.Abp.Internal.Telemetry.Constants;
+
+namespace Volo.Abp.Internal.Telemetry.Activity;
+
+public class ActivityEvent : Dictionary
+{
+ public ActivityEvent()
+ {
+ this[ActivityPropertyNames.Id] = Guid.NewGuid();
+ this[ActivityPropertyNames.Time] = DateTimeOffset.UtcNow;
+ }
+
+ public ActivityEvent(string activityName, string? details = null) : this()
+ {
+ Check.NotNullOrWhiteSpace(activityName, nameof(activityName));
+
+ this[ActivityPropertyNames.ActivityName] = activityName;
+ this[ActivityPropertyNames.ActivityDetails] = details;
+ }
+
+ public bool HasSolutionInfo()
+ {
+ return this.ContainsKey(ActivityPropertyNames.HasSolutionInfo);
+ }
+
+ public bool HasDeviceInfo()
+ {
+ return this.ContainsKey(ActivityPropertyNames.HasDeviceInfo);
+ }
+
+ public bool HasProjectInfo()
+ {
+ return this.ContainsKey(ActivityPropertyNames.HasProjectInfo);
+ }
+
+ public T Get(string key)
+ {
+ return TryConvert(key, out var value) ? value : default!;
+ }
+
+ public bool TryGetValue(string key, out T value)
+ {
+ return TryConvert(key, out value);
+ }
+
+ private bool TryConvert(string key, out T result)
+ {
+ result = default!;
+ if (!this.TryGetValue(key, out var value) || value is null)
+ {
+ return false;
+ }
+
+ try
+ {
+ if (value is T tValue)
+ {
+ result = tValue;
+ return true;
+ }
+
+ if (value is JsonElement jsonElement)
+ {
+ value = ExtractFromJsonElement(jsonElement);
+ if (value is null)
+ {
+ return false;
+ }
+ }
+
+ var targetType = typeof(T);
+ var underlyingType = Nullable.GetUnderlyingType(targetType) ?? targetType;
+ if (underlyingType.IsEnum)
+ {
+ if (value is string str)
+ {
+ result = (T)Enum.Parse(underlyingType, str, ignoreCase: true);
+ }
+ else if (value is int intValue)
+ {
+ result = (T)Enum.ToObject(underlyingType, intValue);
+ }
+
+ return true;
+ }
+
+
+ if (underlyingType == typeof(Dictionary[]))
+ {
+ result = (T)value;
+ return true;
+ }
+
+ if (underlyingType == typeof(Guid))
+ {
+ result = (T)(object)Guid.Parse(value.ToString()!);
+ return true;
+ }
+
+ if (underlyingType == typeof(DateTimeOffset))
+ {
+ result = (T)(object)DateTimeOffset.Parse(value.ToString()!);
+ return true;
+ }
+
+ // Nullable types
+ result = (T)Convert.ChangeType(value, underlyingType);
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ private static object? ExtractFromJsonElement(JsonElement element)
+ {
+ return element.ValueKind switch
+ {
+ JsonValueKind.String => element.GetString(),
+ JsonValueKind.Number => element.GetInt32(),
+ JsonValueKind.True => true,
+ JsonValueKind.False => false,
+ JsonValueKind.Null => null,
+ JsonValueKind.Array => element.EnumerateArray()
+ .Select(item =>
+ {
+ if (item.ValueKind == JsonValueKind.Object)
+ {
+ return item.EnumerateObject()
+ .ToDictionary(prop => prop.Name, prop => ExtractFromJsonElement(prop.Value));
+ }
+
+ return new Dictionary { { "value", ExtractFromJsonElement(item) } };
+ })
+ .ToArray(),
+
+ JsonValueKind.Object => element.EnumerateObject()
+ .ToDictionary(prop => prop.Name, prop => ExtractFromJsonElement(prop.Value)),
+ _ => element.ToString()
+ };
+ }
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/Contracts/IHasParentTelemetryActivityEventEnricher.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/Contracts/IHasParentTelemetryActivityEventEnricher.cs
new file mode 100644
index 0000000000..5547445d54
--- /dev/null
+++ b/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/Contracts/IHasParentTelemetryActivityEventEnricher.cs
@@ -0,0 +1,7 @@
+using Volo.Abp.Internal.Telemetry.Activity.Providers;
+
+namespace Volo.Abp.Internal.Telemetry.Activity.Contracts;
+
+public interface IHasParentTelemetryActivityEventEnricher where TParent: TelemetryActivityEventEnricher
+{
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/Contracts/ITelemetryActivityEventBuilder.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/Contracts/ITelemetryActivityEventBuilder.cs
new file mode 100644
index 0000000000..0542b9d676
--- /dev/null
+++ b/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/Contracts/ITelemetryActivityEventBuilder.cs
@@ -0,0 +1,8 @@
+using System.Threading.Tasks;
+
+namespace Volo.Abp.Internal.Telemetry.Activity.Contracts;
+
+public interface ITelemetryActivityEventBuilder
+{
+ Task BuildAsync(ActivityContext context);
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/Contracts/ITelemetryActivityEventEnricher.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/Contracts/ITelemetryActivityEventEnricher.cs
new file mode 100644
index 0000000000..b83741cd88
--- /dev/null
+++ b/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/Contracts/ITelemetryActivityEventEnricher.cs
@@ -0,0 +1,11 @@
+using System.Threading.Tasks;
+
+namespace Volo.Abp.Internal.Telemetry.Activity.Contracts;
+
+public interface ITelemetryActivityEventEnricher
+{
+ int ExecutionOrder { get; }
+
+ Task EnrichAsync(ActivityContext context);
+
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/Contracts/ITelemetryActivityStorage.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/Contracts/ITelemetryActivityStorage.cs
new file mode 100644
index 0000000000..870876ffbd
--- /dev/null
+++ b/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/Contracts/ITelemetryActivityStorage.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+
+namespace Volo.Abp.Internal.Telemetry.Activity.Contracts;
+
+public interface ITelemetryActivityStorage
+{
+ Guid InitializeOrGetSession();
+ void DeleteActivities(ActivityEvent[] activities);
+ void SaveActivity(ActivityEvent activityEvent);
+ List GetActivities();
+ bool ShouldAddDeviceInfo();
+ bool ShouldAddSolutionInformation(Guid solutionId);
+ bool ShouldAddProjectInfo(Guid projectId);
+ bool ShouldSendActivities();
+ void MarkActivitiesAsFailed(ActivityEvent[] activities);
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/Providers/TelemetryActivityEventBuilder.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/Providers/TelemetryActivityEventBuilder.cs
new file mode 100644
index 0000000000..201ac8c3b6
--- /dev/null
+++ b/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/Providers/TelemetryActivityEventBuilder.cs
@@ -0,0 +1,49 @@
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Volo.Abp.DependencyInjection;
+using Volo.Abp.DynamicProxy;
+using Volo.Abp.Internal.Telemetry.Activity.Contracts;
+using Volo.Abp.Internal.Telemetry.Constants;
+
+namespace Volo.Abp.Internal.Telemetry.Activity.Providers;
+
+public class TelemetryActivityEventBuilder : ITelemetryActivityEventBuilder, ISingletonDependency
+{
+ private readonly List _activityEnrichers;
+
+ public TelemetryActivityEventBuilder(IEnumerable activityDataEnrichers)
+ {
+ _activityEnrichers = activityDataEnrichers
+ .Where(FilterEnricher)
+ .OrderByDescending(x => x.ExecutionOrder)
+ .ToList();
+ }
+ public virtual async Task BuildAsync(ActivityContext context)
+ {
+ foreach (var enricher in _activityEnrichers)
+ {
+ try
+ {
+ await enricher.EnrichAsync(context);
+ }
+ catch
+ {
+ //ignored
+ }
+
+ if (context.IsTerminated)
+ {
+ return null;
+ }
+ }
+
+ return context.Current;
+ }
+
+ private static bool FilterEnricher(ITelemetryActivityEventEnricher enricher)
+ {
+ return ProxyHelper.GetUnProxiedType(enricher).Assembly.FullName!.StartsWith(TelemetryConsts.VoloNameSpaceFilter) &&
+ enricher is not IHasParentTelemetryActivityEventEnricher;
+ }
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/Providers/TelemetryActivityEventEnricher.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/Providers/TelemetryActivityEventEnricher.cs
new file mode 100644
index 0000000000..d25e9c58f8
--- /dev/null
+++ b/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/Providers/TelemetryActivityEventEnricher.cs
@@ -0,0 +1,70 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.Extensions.DependencyInjection;
+using Volo.Abp.DependencyInjection;
+using Volo.Abp.DynamicProxy;
+using Volo.Abp.Internal.Telemetry.Activity.Contracts;
+
+namespace Volo.Abp.Internal.Telemetry.Activity.Providers;
+
+public abstract class TelemetryActivityEventEnricher : ITelemetryActivityEventEnricher, IScopedDependency
+{
+ public virtual int ExecutionOrder { get; set; } = 0;
+ protected bool IgnoreChildren { get; set; }
+ protected virtual Type? ReplaceParentType { get; set; }
+
+ private readonly IServiceProvider _serviceProvider;
+
+ protected TelemetryActivityEventEnricher(IServiceProvider serviceProvider)
+ {
+ _serviceProvider = serviceProvider;
+ }
+
+ public async Task EnrichAsync(ActivityContext context)
+ {
+ if (!await CanExecuteAsync(context))
+ {
+ return;
+ }
+
+ await ExecuteAsync(context);
+ await ExecuteChildrenAsync(context);
+ }
+
+ protected virtual Task CanExecuteAsync(ActivityContext context)
+ {
+ return Task.FromResult(true);
+ }
+
+ protected abstract Task ExecuteAsync(ActivityContext context);
+
+ protected virtual async Task ExecuteChildrenAsync(ActivityContext context)
+ {
+ if (IgnoreChildren)
+ {
+ return;
+ }
+
+ using var scope = _serviceProvider.CreateScope();
+
+ foreach (var child in GetChildren(scope.ServiceProvider))
+ {
+ await child.EnrichAsync(context);
+ }
+ }
+
+ private ITelemetryActivityEventEnricher[] GetChildren(IServiceProvider serviceProvider)
+ {
+ var targetType = ReplaceParentType ?? ProxyHelper.GetUnProxiedType(this);
+ var genericInterfaceType = typeof(IHasParentTelemetryActivityEventEnricher<>).MakeGenericType(targetType);
+ var enumerableType = typeof(IEnumerable<>).MakeGenericType(genericInterfaceType);
+
+ var childServices = (IEnumerable