Пример #1
0
        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>());
        }
Пример #2
0
        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>();
        }
Пример #3
0
        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>());
        }
Пример #4
0
 private static void ConfigureBoxsie(IServiceProvider serviceProvider)
 {
     Cfg.InitialiseConfig(serviceProvider);
 }