コード例 #1
0
        public SiteFarmService(ApplicationDbContext dbContext, IBiographyGenerationService biographyGenerationService, HttpClient httpClient, IOptions <SiteFarmConfiguration> config)
        {
            this.dbContext = dbContext;
            this.biographyGenerationService = biographyGenerationService;
            this.httpClient = httpClient;
            this.config     = config.Value;

            // TODO: determine if we want to set auth at the service level
            this.httpClient.DefaultRequestHeaders.Authorization =
                new AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.ASCII.GetBytes(String.Format("{0}:{1}", this.config.ApiUsername, this.config.ApiPassword))));
        }
コード例 #2
0
 public SitePeopleController(ApplicationDbContext dbContext, IBiographyGenerationService biographyGenerationService)
 {
     this.dbContext = dbContext;
     this.biographyGenerationService = biographyGenerationService;
 }