Programming

Reading Lists from appsettings.json

Reading Lists from appsettings.json I’ve been using the SendGrid API for a project and I was trying to be lazy and read multiple email addresses to send to from a single parameter in appsettings.json with the email addresses seperated by a semicolon. Strangely this only sends to the first email Read more…

By Shinigami, ago
Programming

appsettings.json in .NET Core Console App

Adding appsettings.json to a .NET Core console app This is something that’s strangely doesn’t seem to be that well documented and took me a while to figure out though in the end it’s pretty simple. All that’s required is to add the following NuGet packages and an appsettings.json file. Microsoft.Extensions.Configuration Read more…

By Shinigami, ago
Programming

ASP.NET Core Connection Strings Class

There’s various different ways to access values from appsettings.json in ASP.NET Core, one way to do this is create a corresponding settings class and map the values to it. First off, add a connection stings section to your appsettings.json file like so (where {ConnectionString} obviously equals your connection string). "ConnectionStrings": Read more…

By Shinigami, ago