山东雷驰
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
2.6 KiB

3 months ago
using AutoMapper;
using Kean.Domain.Stock.Commands;
using Kean.Domain.Stock.Events;
using Kean.Domain.Stock.Models;
namespace Kean.Domain.Stock
{
/// <summary>
/// 模型映射配置
/// </summary>
public class AutoMapper : Profile
{
/// <summary>
/// 初始化 Kean.Domain.Stock.AutoMapper 类的新实例
/// </summary>
public AutoMapper()
{
AllowNullCollections = true;
CreateMap<InboundCommand, Models.Stock>().ReverseMap();
CreateMap<InboundCommand, InboundExecutingEvent>();
CreateMap<InboundCommand, InboundSuccessEvent>();
CreateMap<InboundSuccessEvent, Record>();
CreateMap<OutboundCommand, Models.Stock>().ReverseMap();
CreateMap<OutboundCommand, OutboundExecutingEvent>();
CreateMap<OutboundCommand, OutboundSuccessEvent>();
CreateMap<OutboundSuccessEvent, Record>();
CreateMap<UpdateCommand, Models.Stock>();
CreateMap<UpdateCommand, UpdateExecutingEvent>();
CreateMap<UpdateCommand, UpdateSuccessEvent>();
CreateMap<UpdateSuccessEvent, Record>();
CreateMap<CombineCommand, InboundCommand>();
CreateMap<CombineCommand, OutboundCommand>();
CreateMap<RelocateCommand, RelocateSuccessEvent>();
CreateMap<RelocateSuccessEvent, Record>();
/////////////////////////////////////////////
CreateMap<PalletInCommand, Models.Stock>().ReverseMap();
CreateMap<PalletInCommand, PalletInExecutingEvent>();
CreateMap<PalletInCommand, PalletInSuccessEvent>();
CreateMap<PalletInSuccessEvent, Record>();
//CreateMap<CombineCommand, PalletInCommand>();
CreateMap<ScanInboundCommand, Models.Stock>().ReverseMap();
CreateMap<ScanInboundCommand, ScanInboundExecutingEvent>();
CreateMap<ScanInboundCommand, ScanInboundSuccessEvent>();
CreateMap<ScanInboundSuccessEvent, Record>();
//CreateMap<CombineCommand, ScanInboundCommand>();
CreateMap<AutoOutCommand, Models.Stock>().ReverseMap();
CreateMap<AutoOutCommand, AutoOutExecutingEvent>();
CreateMap<AutoOutCommand, AutoOutSuccessEvent>();
CreateMap<AutoOutSuccessEvent, Record>();
//CreateMap<CombineCommand, AutoOutCommand>();
CreateMap<ScanInboundCommand, PalletInCommand>();
CreateMap<RecordCommand, Record>();
CreateMap<Models.Stock, UpdateCommand>();
}
}
}