Skip to content

Instantly share code, notes, and snippets.

@MahdiKarimipour
Created June 25, 2021 01:07
Show Gist options
  • Save MahdiKarimipour/574b3c491f5b02a96f00927c8556db72 to your computer and use it in GitHub Desktop.
Save MahdiKarimipour/574b3c491f5b02a96f00927c8556db72 to your computer and use it in GitHub Desktop.
App Secrets Access
public class EmailSender
{
private readonly IConfiguration configuration;
public EmailSender(IConfiguration configuration)
{
this.configuration = configuration;
}
public async Task SendEmailAsync()
{
var sendGridApiKey = configuration
.GetSection(nameof(AppSecrets))
.Get<AppSecrets>()
.SendGridSecrets
.ApiKey;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment