// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { var faceBookOption = new FaceBookOption(); Configuration.Bind(nameof(FaceBookOption), faceBookOption); services.AddSingleton(faceBookOption); services.AddHttpClient(); services.AddScoped <IFaceBookService, FaceBookService>(); services.AddControllers(); }
public FaceBookService(FaceBookOption faceBookOption, IHttpClientFactory httpClientFactory) { _faceBookOption = faceBookOption; _httpClientFactory = httpClientFactory; }