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

List Shuffling

List Shuffling This is just a simple extension for lists to enable the shuffling of items within it based on the StackOverflow answer here. This relies on System.Random so isn’t as random as it could be but is fine for my purposes. public static IEnumerable<T> Shuffle<T>(this IEnumerable<T> source, Random rng) Read more…

By Shinigami, ago
Programming

Splitting Lists Into Chunks

Splitting lists into chunks. Whilst writing a process to upload instore purchases to Facebook using their offline conversion API I discovered that their API only accepts a maximum of 2,100 events in any one API call. As I already ahd a nice list of events I had a look around 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