Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GoogleAdsClient to DI container #540

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

jeffdahl
Copy link

@jeffdahl jeffdahl commented Oct 24, 2023

With minimal impact to the Google.Ads.GoogleAds.Core project (only adding two interfaces), this PR introduces the Google.Ads.GoogleAds.Extensions.DependencyInjection project. This new project can be packaged independently providing flexibility to include it only when needed. If using dependency injection, GoogleAds can now be configured and injected into the DI container with one line:

services.AddGoogleAdsClient(Configuration);

Once called, the DI container has a configured IGoogleAdsClient that can be injected like any other dependency.

The test project, Google.Ads.GoogleAds.Extensions.DependencyInjection.Tests, shows this in action.

Closes #483

@jeffdahl jeffdahl requested a review from a team as a code owner October 24, 2023 16:38
@jradcliff jradcliff requested review from AnashOommen and removed request for jradcliff October 24, 2023 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configure using the options pattern
1 participant