// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { //services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); var sconfig = new SalesForceConfiguration(); Configuration.Bind("SalesForce", sconfig); services.AddSingleton(sconfig); services.AddSwaggerGen(c => { c.SwaggerDoc(Configuration["Swagger:Version"], new Info { Title = Configuration["Swagger:Title"], Version = Configuration["Swagger:Version"] }); c.AddSecurityDefinition("Bearer", new ApiKeyScheme { Description = "JWT Authorization header using the Bearer scheme. Example - Authorization: Bearer {token}", Name = "Authorization", In = "header", Type = "apiKey" }); c.DocumentFilter <SecurityRequirementsDocumentFilter>(); }); services.AddMvc( config => { config.Filters.Add(typeof(AddVersionHeaderFilter)); config.Filters.Add(typeof(CustomExceptionFilter)); }).SetCompatibilityVersion(CompatibilityVersion.Version_2_1); services.AddScoped <ILogService, LogService>(); services.AddScoped <ISalesForceService, SalesForceService>(); services.AddSingleton <IHttpContextAccessor, HttpContextAccessor>(); services.AddCors(); }
public DataManager(SalesForceConfiguration config = null) { _config = config ?? throw new ArgumentNullException(nameof(config)); authenticate(); }
public SalesForceService(IConfiguration configuration, SalesForceConfiguration sconfig) { Configuration = configuration; SConfig = sconfig; }