-
Notifications
You must be signed in to change notification settings - Fork 586
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
Dependency Injection in Startup.cs #880
Comments
Hello @KevinMallinson, I don't know the answer to this offhand, I will need to investigate further. In the mean time, could you please elaborate on what the behavior you are seeking would look like in code if we had already implemented it so that I may better understand your workflow? With Best Regards, Elmer |
The behaviour would look something like this (psuedocode):
Hopefully that makes sense, Thanks. Edit: Changed the example to look more like the Twilio example |
Thank you @KevinMallinson, Your description was very helpful, thanks for taking the time! I've added this to our internal backlog for consideration as well as opened it up for community contribution. With Best Regards, Elmer |
This could be added relatively easily by adding a constructor that accepts an In your DI configuration, you'd do something along the lines of:
Let me know if you want me to apply these changes, I'll happily implement them and submit a PR. |
Hello @aevitas, A PR would be most welcome. Thank you! With best regards, Elmer |
You can use Install-Package SendGrid.Extensions.DependencyInjection -Version 1.0.0 builder.Services.AddSendGrid(options => { |
Hi, sorry for not following the template, but regarding issues #847 and #521, I was wondering if there is any progress?
I would like to inject a SendGridClient through DI to a controller, instead of instantiating a new client every request.
I can't rely on
services.AddHttpClient<ISendGridClient, SendGridClient>();
because I need to add theKey
that is typically called in the SendGridClient constructor.Is this workflow being looked in to?
Thanks
The text was updated successfully, but these errors were encountered: