public DynamicsController( ILogger <DocumentController> logger, IOptions <AppOptions> appOptions, IDocumentService documentService, IOpportunityService opportunityService, IGraphClientAppContext graphClientAppContext, IOneDriveLinkService oneDriveLinkService, IConfiguration configuration, IDynamicsLinkService dynamicsLinkService, IProposalManagerClientFactory proposalManagerClientFactory) : base(logger, appOptions) { this.oneDriveLinkService = oneDriveLinkService; this.graphClientAppContext = graphClientAppContext; this.dynamicsLinkService = dynamicsLinkService; this.opportunityService = opportunityService; this.proposalManagerClientFactory = proposalManagerClientFactory; oneDriveConfiguration = new OneDriveConfiguration(); configuration.Bind(OneDriveConfiguration.ConfigurationName, oneDriveConfiguration); dynamicsConfiguration = new Dynamics365Configuration(); configuration.Bind(Dynamics365Configuration.ConfigurationName, dynamicsConfiguration); proposalManagerConfiguration = new ProposalManagerConfiguration(); configuration.Bind(ProposalManagerConfiguration.ConfigurationName, proposalManagerConfiguration); }
public ProposalManagerClientFactory(IWebApiAuthProvider webApiAuthProvider, IConfiguration configuration) { proposalManagerConfiguration = new ProposalManagerConfiguration(); configuration.Bind(ProposalManagerConfiguration.ConfigurationName, proposalManagerConfiguration); azureAdConfiguration = new AzureAdOptions(); configuration.Bind("AzureAd", azureAdConfiguration); this.webApiAuthProvider = webApiAuthProvider; }
public DaemonHelper(IRootConfigurationProvider rootConfigurationProvider) { azureAdConfiguration = rootConfigurationProvider.AzureAdConfiguration; proposalManagerConfiguration = rootConfigurationProvider.ProposalManagerConfiguration; client.BaseAddress = new Uri(proposalManagerConfiguration.ApiUrl); client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); }