예제 #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc(options =>
            {
                options.Filters.Add(typeof(GlobalExceptionFilter));
            }).SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

            DIConfiguration.Configurate(services, Configuration);
        }
예제 #2
0
        public void Setup()
        {
            var services      = new ServiceCollection();
            var configuration = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build();

            DIConfiguration.Configurate(services, configuration);
            var provider = services.BuildServiceProvider();
            var servs    = provider.GetServices <IHostedService>();

            _bitcoindClient = provider.GetRequiredService <IBitcoindClient>();
            //_walletService = (WalletService)provider.GetService(typeof(WalletService));
            //_dataContext = (DataContext)provider.GetService(typeof(DataContext));

            //init automapper
            Mapper.Initialize(cfg => {
                cfg.AddProfile <AutoMapperProfile>();
            });

            var b = new BitcoinSingleTransactionDto()
            {
                Txid          = "1",
                Confirmations = 4,
                Time          = 5,
                Details       = new List <Details>
                {
                    new Details
                    {
                        Address  = "2",
                        Category = "send",
                        Amount   = 3
                    }
                }
            };

            var t = Mapper.Map <Transaction>(b);
        }