using AutoMapper; using Binance.TradeRobot.Model.Db; using Binance.TradeRobot.Model.Dto; namespace Binance.TradeRobot.Model.Base { public class MappingProfiles : Profile { public MappingProfiles() { CreateMap(); CreateMap(); CreateMap(); CreateMap(); CreateMap(); CreateMap(); CreateMap(); CreateMap(); CreateMap().ForPath(t => t.RobotAccount.Id, opt => opt.MapFrom(f => f.RobotAccountId)) .ForPath(t => t.RobotAccount.RobotId, opt => opt.MapFrom(f => f.Id)) .ForPath(t => t.RobotAccount.SoptCurrentcyAmount, opt => opt.MapFrom(f => f.SoptCurrentcyAmount)) .ForPath(t => t.RobotAccount.SpotCurrencyQuantity, opt => opt.MapFrom(f => f.SpotCurrencyQuantity)) .ForPath(t => t.RobotAccount.ClosePositionCount, opt => opt.MapFrom(f => f.ClosePositionCount)) .ForPath(t => t.RobotAccount.LoanAmount, opt => opt.MapFrom(f => f.LoanAmount)) .ForPath(t => t.RobotAccount.TotalProfit, opt => opt.MapFrom(f => f.TotalProfit)) .ForPath(t => t.RobotAccount.WinCount, opt => opt.MapFrom(f => f.WinCount)); CreateMap().IncludeBase() .ForPath(t => t.D21Policy.Id, opt => opt.MapFrom(f => f.D21PolicyId)) .ForPath(t => t.D21Policy.RobotId, opt => opt.MapFrom(f => f.Id)) .ForPath(t => t.D21Policy.Position, opt => opt.MapFrom(f => f.D21Position)) .ForPath(t => t.D21Policy.IsEnabledIncreasePurchase, opt => opt.MapFrom(f => f.D21IsEnabledIncreasePurchase)) .ForPath(t => t.D21Policy.IsEnableRemedyForErrorCrossSignal, opt => opt.MapFrom(f => f.D21IsEnableRemedyForErrorCrossSignal)) .ForPath(t => t.D21Policy.PeriodicSignal, opt => opt.MapFrom(f => f.D21PeriodicSignal)) .ForPath(t => t.D21Policy.MaxFollowPurchaseRatio, opt => opt.MapFrom(f => f.D21MaxFollowPurchaseRatio)) .ForPath(t => t.D21Policy.StopLossRatio, opt => opt.MapFrom(f => f.D21StopLossRatio)) .ForPath(t => t.D21Policy.CreateTime, opt => opt.MapFrom(f => f.D21CreateTime)) .ForPath(t => t.D21Policy.ExecutionMode, opt => opt.MapFrom(f => f.D21ExecutionMode)); } } }