public static void LoadUserData(IServiceProvider serviceProvider, string appRootPath) { var exchangeServices = serviceProvider.GetServices <IExchangeService>(); Mapper.Initialize(cfg => { cfg.AddProfile <DataProfile>(); foreach (var exchangeService in exchangeServices) { exchangeService.ConfigureMap(cfg); } cfg.CreateMap <Candle, CandleDto>() .ForMember(d => d.Timestamp, o => o.MapFrom(s => s.Timestamp)) .ForMember(d => d.Instrument, m => m.Ignore()) .ForMember(d => d.ExchangeName, m => m.Ignore()) .ForMember(d => d.Period, m => m.Ignore()); cfg.CreateMap <PositionDto, PositionDto>() .ForAllMembers(o => o.Condition((s, d, srcM, destM) => srcM != null)); }); Cfg.InitialiseConfig(serviceProvider.GetServices <IConfig>()); }
public static void Configure(IServiceProvider serviceProvider) { Cfg.InitialiseConfig(serviceProvider); var logFactory = serviceProvider.GetService <ILoggerFactory>(); logFactory.AddProvider(new BxLoggerProvider(Cfg.GetConfig <GeneralConfig>())); serviceProvider.GetService <RepositoryService>().EnsureDbCreated(); App = serviceProvider.GetService <IBxApp>(); }
public static void LoadUserData(IServiceProvider serviceProvider, string appRootPath) { var exchangeServices = serviceProvider.GetServices <IExchangeService>(); Mapper.Initialize(cfg => { cfg.AddProfile <DataProfile>(); foreach (var exchangeService in exchangeServices) { exchangeService.ConfigureMap(cfg); } }); Cfg.InitialiseConfig(serviceProvider.GetServices <IConfig>()); }
private static void ConfigureBoxsie(IServiceProvider serviceProvider) { Cfg.InitialiseConfig(serviceProvider); }