Browse Source

Merge pull request #23190 from abpframework/modular-tutorial-small-fixes

Modular tutorial small fixes
pull/23191/head
Halil İbrahim Kalkan 1 year ago
committed by GitHub
parent
commit
10b459a791
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 12
      docs/en/tutorials/modular-crm/part-05.md
  2. 11
      docs/en/tutorials/modular-crm/part-06.md
  3. 11
      docs/en/tutorials/modular-crm/part-07.md

12
docs/en/tutorials/modular-crm/part-05.md

@ -75,7 +75,6 @@ Open your IDE, in `Data` folder under the `ModularCrm.Ordering` project, and edi
````csharp ````csharp
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using ModularCrm.Ordering.Entities;
using Volo.Abp.Data; using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore;
@ -92,7 +91,6 @@ Afterwards, create *Orders* `DbSet` for the `OrderingDbContext` class in the `Da
````csharp ````csharp
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using ModularCrm.Ordering.Entities;
using Volo.Abp.Data; using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore;
@ -103,9 +101,10 @@ public class OrderingDbContext : AbpDbContext<OrderingDbContext>, IOrderingDbCon
{ {
public DbSet<Order> Orders { get; set; } public DbSet<Order> Orders { get; set; }
public OrderingDbContext(DbContextOptions<OrderingDbContext> options) : base(options) public OrderingDbContext(DbContextOptions<OrderingDbContext> options)
: base(options)
{ {
} }
protected override void OnModelCreating(ModelBuilder builder) protected override void OnModelCreating(ModelBuilder builder)
@ -123,7 +122,6 @@ It is best to configure the database table mapping for the `Order` entity in the
````csharp ````csharp
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using ModularCrm.Ordering.Entities;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.EntityFrameworkCore.Modeling; using Volo.Abp.EntityFrameworkCore.Modeling;
@ -184,7 +182,7 @@ public class ModularCrmDbContext :
protected override void OnModelCreating(ModelBuilder builder) protected override void OnModelCreating(ModelBuilder builder)
{ {
... ...
builder.ConfigureOrdering(); //NEW: CALL THE EXTENSION METHOD builder.ConfigureOrdering();
} }
```` ````
@ -309,7 +307,7 @@ using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Repositories;
namespace ModularCrm.Ordering.Services; namespace ModularCrm.Ordering;
public class OrderAppService : OrderingAppService, IOrderAppService public class OrderAppService : OrderingAppService, IOrderAppService
{ {

11
docs/en/tutorials/modular-crm/part-06.md

@ -56,11 +56,10 @@ Open the `IProductIntegrationService.cs` file and replace it's content with the
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using ModularCrm.Catalog;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
namespace ModularCrm.Products.Integration; namespace ModularCrm.Catalog.Integration;
[IntegrationService] [IntegrationService]
public interface IProductIntegrationService : IApplicationService public interface IProductIntegrationService : IApplicationService
@ -91,11 +90,10 @@ Open the `ProductIntegrationService.cs` file and replace its content with the fo
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using ModularCrm.Catalog;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Repositories;
namespace ModularCrm.Products.Integration; namespace ModularCrm.Catalog.Integration;
[IntegrationService] [IntegrationService]
public class ProductIntegrationService public class ProductIntegrationService
@ -152,13 +150,12 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using ModularCrm.Products.Integration; using ModularCrm.Catalog.Integration;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Repositories;
namespace ModularCrm.Ordering; namespace ModularCrm.Ordering;
public class OrderAppService : ApplicationService, IOrderAppService public class OrderAppService : OrderingAppService, IOrderAppService
{ {
private readonly IRepository<Order, Guid> _orderRepository; private readonly IRepository<Order, Guid> _orderRepository;
private readonly IProductIntegrationService _productIntegrationService; private readonly IProductIntegrationService _productIntegrationService;

11
docs/en/tutorials/modular-crm/part-07.md

@ -64,12 +64,12 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using ModularCrm.Catalog.Integration;
using ModularCrm.Ordering.Events; using ModularCrm.Ordering.Events;
using ModularCrm.Products.Integration;
using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Repositories;
using Volo.Abp.EventBus.Distributed; using Volo.Abp.EventBus.Distributed;
namespace ModularCrm.Ordering.Services; namespace ModularCrm.Ordering;
public class OrderAppService : OrderingAppService, IOrderAppService public class OrderAppService : OrderingAppService, IOrderAppService
{ {
@ -163,22 +163,21 @@ You can check the ABP Studio's *Solution Explorer* panel to see the module impor
Now, it is possible to use the `OrderPlacedEto` class inside the Catalog module since it has the `ModularCrm.Ordering.Contracts` package reference. Now, it is possible to use the `OrderPlacedEto` class inside the Catalog module since it has the `ModularCrm.Ordering.Contracts` package reference.
Open the Catalog module's .NET solution in your IDE, locate the `ModularCrm.Catalog` project, and create a new `Orders` folder and an `OrderEventHandler` class inside that folder. The final folder structure should be like this: Open the Catalog module's .NET solution in your IDE, locate the `ModularCrm.Catalog` project, and create a new `EventHandlers` folder and an `OrderEventHandler` class inside that folder. The final folder structure should be like this:
![visual-studio-order-event-handler](images/visual-studio-order-event-handler-v2.png) ![visual-studio-order-event-handler](images/visual-studio-order-event-handler-v2.png)
Replace the `OrderEventHandler.cs` file's content with the following code block: Replace the `OrderEventHandler.cs` file's content with the following code block:
````csharp ````csharp
using ModularCrm.Catalog;
using ModularCrm.Ordering.Events;
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using ModularCrm.Ordering.Events;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Repositories;
using Volo.Abp.EventBus.Distributed; using Volo.Abp.EventBus.Distributed;
namespace ModularCrm.Products.Orders; namespace ModularCrm.Catalog.EventHandlers;
public class OrderEventHandler : public class OrderEventHandler :
IDistributedEventHandler<OrderPlacedEto>, IDistributedEventHandler<OrderPlacedEto>,

Loading…
Cancel
Save