Programming

Building URIs in .NET Core

Building URIs in .NET Core. Creating URIs with parameters in .NET Core is more complicated than I’d initially expected. As a result I ended up creating my own methods based upon this Stack Overflow answer. To begin with I needed a version to return relative paths I’ve also created a Read more…

By Shinigami, ago
Programming

SQL Stored Procedure in .NET Core

SQL stored procedure in .NET Core. I call SQL stored procedures slightly differently in .NET Core to the way I did in .NET framework as I now pass the connection string through as an argument and I need to remember to add the System.Data.SqlClient NuGet package. public static List<string> GetBlogSummaries(string Read more…

By Shinigami, ago
Programming

Comparing List Objects

Comparing objects between 2 different lists to determine which have different properties. I have a list of EventType objects with the following definition. public class EventType { public int EventTypeId { get; set; } public string EventTypeDesc { get; set; } public DateTime CreateDate { get; set; } public int 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 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

NuGet Package Creation

How to create a NuGet package from a .NET Core class library I’ve built a few class libraries recently but in order to use them in other projects they need to be created as a NuGet package and uploaded. The easiest way to creat the NuGet package is to add Read more…

By Shinigami, ago