山东雷驰
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.
 
 
 
 

38 lines
1.6 KiB

using AutoMapper;
using Kean.Domain.Order.Commands;
using Kean.Domain.Order.Events;
using Kean.Domain.Order.Models;
using System.Collections.Generic;
namespace Kean.Domain.Order
{
/// <summary>
/// 模型映射配置
/// </summary>
public class AutoMapper : Profile
{
/// <summary>
/// 初始化 Kean.Domain.Order.AutoMapper 类的新实例
/// </summary>
public AutoMapper()
{
CreateMap<IEnumerable<string>, Format>().ConvertUsing(value => new(value));
CreateMap<CreateTypeCommand, Type>().ForMember(model => model.Menu, options => options.Ignore());
CreateMap<ModifyTypeCommand, Type>().ForMember(model => model.Menu, options => options.Ignore());
CreateMap<CreateTypeCommand, CreateTypeSuccessEvent>().ForMember(model => model.Menu, options => options.Ignore());
CreateMap<ModifyTypeCommand, ModifyTypeSuccessEvent>().ForMember(model => model.Menu, options => options.Ignore());
CreateMap<DeleteTypeCommand, DeleteTypeSuccessEvent>();
CreateMap<CreateFlowCommand, Flow>();
CreateMap<ModifyFlowCommand, Flow>();
CreateMap<CreateFlowCommand, CreateFlowSuccessEvent>();
CreateMap<ModifyFlowCommand, ModifyFlowSuccessEvent>();
CreateMap<DeleteFlowCommand, DeleteFlowSuccessEvent>();
CreateMap<CreateOrderCommand, Models.Order>();
CreateMap<CreateOrderCommand, CreateOrderSuccessEvent>();
CreateMap<ModifyOrderCommand, ModifyOrderSuccessEvent>();
CreateMap<DeleteOrderCommand, DeleteOrderSuccessEvent>();
}
}
}