using AutoMapper; using BBWYB.Server.Model.Db; using BBWYB.Server.Model.Dto; namespace BBWYB.Server.Model { public class MappingProfiles : Profile { // private IDictionary storeDictionary; public MappingProfiles() { CreateMap(); CreateMap(); CreateMap(); CreateMap(); CreateMap(); CreateMap(); CreateMap(); //CreateMap(); //CreateMap(); //CreateMap(); //CreateMap(); //CreateMap(); CreateMap(); CreateMap(); CreateMap(); //CreateMap(); CreateMap().ForMember(t => t.Id, opt => opt.MapFrom(f => f.SkuId)); CreateMap().ForPath(t => t.Consignee.Province, opt => opt.MapFrom(f => f.Province)) .ForPath(t => t.Consignee.City, opt => opt.MapFrom(f => f.City)) .ForPath(t => t.Consignee.County, opt => opt.MapFrom(f => f.County)) .ForPath(t => t.Consignee.Town, opt => opt.MapFrom(f => f.Town)) .ForPath(t => t.Consignee.Address, opt => opt.MapFrom(f => f.Address)) .ForPath(t => t.Consignee.Mobile, opt => opt.MapFrom(f => f.Mobile)) .ForPath(t => t.Consignee.TelePhone, opt => opt.MapFrom(f => f.TelePhone)) .ForPath(t => t.Consignee.ContactName, opt => opt.MapFrom(f => f.ContactName)) .ForPath(t => t.OrderCost.OrderId, opt => opt.MapFrom(f => f.Id)) .ForPath(t => t.OrderCost.PurchaseAmount, opt => opt.MapFrom(f => f.PurchaseAmount ?? 0)) .ForPath(t => t.OrderCost.Profit, opt => opt.MapFrom(f => f.Profit ?? 0)) .ForPath(t => t.OrderCost.DeliveryExpressFreight, opt => opt.MapFrom(f => f.DeliveryExpressFreight ?? 0)) .ForPath(t => t.OrderCost.PlatformCommissionAmount, opt => opt.MapFrom(f => f.PlatformCommissionAmount ?? 0)) .ForPath(t => t.OrderCost.PlatformCommissionRatio, opt => opt.MapFrom(f => f.PlatformCommissionRatio ?? 0)) .ForPath(t => t.OrderCost.PreferentialAmount, opt => opt.MapFrom(f => f.PreferentialAmount)) .ForPath(t => t.OrderCost.IsManualEdited, opt => opt.MapFrom(f => f.IsManualEdited)) .ForPath(t => t.OrderCost.SkuAmount, opt => opt.MapFrom(f => f.SkuAmount)) .ForPath(t => t.OrderCost.PurchaseFreight, opt => opt.MapFrom(f => f.PurchaseFreight)); CreateMap(); CreateMap(); CreateMap(); CreateMap(); CreateMap(); CreateMap(); CreateMap(); CreateMap(); CreateMap(); CreateMap(); CreateMap(); } } }