Esempio n. 1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddHttpClient();
            services.AddControllersWithViews();

            var config = new IpayConfiguration();

            Configuration.Bind("Ipay", config);
            services.AddSingleton(config);
            services.AddScoped <IIpayService, IpayService>();
        }
Esempio n. 2
0
 public IpayService(IpayConfiguration configuration, IHttpClientFactory httpClientFactory)
 {
     this.configuration     = configuration;
     this.httpClientFactory = httpClientFactory;
 }