From 6b8e8c937321bfd586bb3e1ce993ddcee5ba3a37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sat, 28 Jun 2025 13:37:33 +0300 Subject: [PATCH 1/2] Fix part08 of modular tutorial for namespace usages --- docs/en/tutorials/modular-crm/part-08.md | 34 +++++++++++------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/docs/en/tutorials/modular-crm/part-08.md b/docs/en/tutorials/modular-crm/part-08.md index 9e00bb1a9e..c322db0d2a 100644 --- a/docs/en/tutorials/modular-crm/part-08.md +++ b/docs/en/tutorials/modular-crm/part-08.md @@ -40,7 +40,7 @@ In this section, we will create an application service in the main application's Open the main `ModularCrm` .NET solution in your IDE, create an `Orders` folder under the `Services` folder and add an `IOrderReportingAppService` interface. Here is the definition of that interface: ````csharp -using ModularCrm.Orders; +using ModularCrm.Services.Dtos; using Volo.Abp.Application.Services; namespace ModularCrm.Services.Orders; @@ -51,13 +51,12 @@ public interface IOrderReportingAppService : IApplicationService } ```` -We have a single method, `GetLatestOrders`, that will return a list of the latest orders. We should also define the `OrderReportDto` class that that method returns. Create the `Orders` folder under the `Services/Dtos` folder and create a class named `OrderReportDto`. +We have a single method, `GetLatestOrders`, that will return a list of the latest orders. We should also define the `OrderReportDto` class that method returns. Create the `Orders` folder under the `Services/Dtos` folder and create a class named `OrderReportDto`. ````csharp -using System; using ModularCrm.Ordering; -namespace ModularCrm.Orders; +namespace ModularCrm.Services.Dtos; public class OrderReportDto { @@ -87,11 +86,10 @@ Open the `OrderReportingAppService.cs` file and change its content by the follow ````csharp using ModularCrm.Catalog; using ModularCrm.Ordering; -using ModularCrm.Services; -using ModularCrm.Services.Orders; +using ModularCrm.Services.Dtos; using Volo.Abp.Domain.Repositories; -namespace ModularCrm.Orders; +namespace ModularCrm.Services.Orders; public class OrderReportingAppService : ModularCrmAppService, @@ -114,16 +112,16 @@ public class OrderReportingAppService : var products = await _productRepository.GetQueryableAsync(); var latestOrders = (from order in orders - join product in products on order.ProductId equals product.Id - orderby order.CreationTime descending - select new OrderReportDto - { - OrderId = order.Id, - CustomerName = order.CustomerName, - State = order.State, - ProductId = product.Id, - ProductName = product.Name - }) + join product in products on order.ProductId equals product.Id + orderby order.CreationTime descending + select new OrderReportDto + { + OrderId = order.Id, + CustomerName = order.CustomerName, + State = order.State, + ProductId = product.Id, + ProductName = product.Name + }) .Take(10) .ToList(); @@ -150,7 +148,7 @@ Open the ABP Studio UI, stop the application if it is running, build and run it You should get the order objects with product names. -Alternatively, you can visit the `/api/app/order-reporting/latest-orders` URL to directly execute the HTTP API on the browser (you should write the full URL, like `https://localhost:44303/api/app/order-reporting/latest-orders` - port can be different for your case) +Alternatively, you can visit the `/api/app/order-reporting/latest-orders` URL to directly execute the HTTP API on the browser (you should write the full URL, like `https://localhost:44303/api/app/order-reporting/latest-orders` - the **port number** can be different for your case) ## Summary From ca348dac800599c12c64c7d718214e8f96f6aaac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sat, 28 Jun 2025 13:40:32 +0300 Subject: [PATCH 2/2] Change namespace of OrderReportDto --- docs/en/tutorials/modular-crm/part-08.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/en/tutorials/modular-crm/part-08.md b/docs/en/tutorials/modular-crm/part-08.md index c322db0d2a..0046f3d82d 100644 --- a/docs/en/tutorials/modular-crm/part-08.md +++ b/docs/en/tutorials/modular-crm/part-08.md @@ -40,7 +40,7 @@ In this section, we will create an application service in the main application's Open the main `ModularCrm` .NET solution in your IDE, create an `Orders` folder under the `Services` folder and add an `IOrderReportingAppService` interface. Here is the definition of that interface: ````csharp -using ModularCrm.Services.Dtos; +using ModularCrm.Services.Dtos.Orders; using Volo.Abp.Application.Services; namespace ModularCrm.Services.Orders; @@ -56,7 +56,7 @@ We have a single method, `GetLatestOrders`, that will return a list of the lates ````csharp using ModularCrm.Ordering; -namespace ModularCrm.Services.Dtos; +namespace ModularCrm.Services.Dtos.Orders; public class OrderReportDto { @@ -86,7 +86,7 @@ Open the `OrderReportingAppService.cs` file and change its content by the follow ````csharp using ModularCrm.Catalog; using ModularCrm.Ordering; -using ModularCrm.Services.Dtos; +using ModularCrm.Services.Dtos.Orders; using Volo.Abp.Domain.Repositories; namespace ModularCrm.Services.Orders;