订单接口和命令映射验证管道
This commit is contained in:
1 parent
780c489e02
commit
3cad5598b7
13 files changed
+309
-50
No files matched your search
@@ -0,0 +1,18 @@
|
||||
// Copyright (c) HelloShop Corporation. All rights reserved.
|
||||
// See the license file in the project root for more information.
|
||||
|
||||
using AutoMapper;
|
||||
using HelloShop.OrderingService.Commands.Orders;
|
||||
using HelloShop.OrderingService.Models.Orders;
|
||||
|
||||
namespace HelloShop.OrderingService.AutoMapper
|
||||
{
|
||||
public class OrdersMapConfiguration : Profile
|
||||
{
|
||||
public OrdersMapConfiguration()
|
||||
{
|
||||
CreateMap<BasketItem, CreateOrderCommand.CreateOrderCommandItem>().ForMember(dest => dest.Units, opts => opts.MapFrom(src => src.Quantity));
|
||||
CreateMap<CreateOrderRequest, CreateOrderCommand>().ForMember(dest => dest.OrderItems, opt => opt.MapFrom(src => src.Items));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user