Browse Source

Merge pull request #20986 from abpframework/doc/modular-crm

Modular crm doc sample refactored
pull/20987/head
Engincan VESKE 2 years ago
committed by GitHub
parent
commit
e6c10da427
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 13
      docs/en/tutorials/modular-crm/part-06.md
  2. 13
      docs/en/tutorials/modular-crm/part-07.md

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

@ -185,15 +185,14 @@ public class OrderAppService : ApplicationService, IOrderAppService
.GetProductsByIdsAsync(productIds)) .GetProductsByIdsAsync(productIds))
.ToDictionary(p => p.Id, p => p.Name); .ToDictionary(p => p.Id, p => p.Name);
var result = ObjectMapper.Map<List<Order>, List<OrderDto>>(orders); var orderDtos = ObjectMapper.Map<List<Order>, List<OrderDto>>(orders);
result = result.Select(a =>
orderDtos.ForEach(orderDto =>
{ {
a.ProductName = products[a.ProductId]; orderDto.ProductName = products[orderDto.ProductId];
return a; });
})
.ToList();
return result; return orderDtos;
} }
public async Task CreateAsync(OrderCreationDto input) public async Task CreateAsync(OrderCreationDto input)

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

@ -101,15 +101,14 @@ public class OrderAppService : ApplicationService, IOrderAppService
.GetProductsByIdsAsync(productIds)) .GetProductsByIdsAsync(productIds))
.ToDictionary(p => p.Id, p => p.Name); .ToDictionary(p => p.Id, p => p.Name);
var result = ObjectMapper.Map<List<Order>, List<OrderDto>>(orders); var orderDtos = ObjectMapper.Map<List<Order>, List<OrderDto>>(orders);
result = result.Select(a =>
orderDtos.ForEach(orderDto =>
{ {
a.ProductName = products[a.ProductId]; orderDto.ProductName = products[orderDto.ProductId];
return a; });
})
.ToList();
return result; return orderDtos;
} }
public async Task CreateAsync(OrderCreationDto input) public async Task CreateAsync(OrderCreationDto input)

Loading…
Cancel
Save