There’s been several times in my C# career where I’ve had to generate new class types at runtime. Hopefully writing about it will help others in the same situation. It also means I won’t have to look up the same StackOverflow articles again in the future! Whilst I originally did this in .NET 4.6.2, I’ve provided samples for the newer .NET Core 3.0. All code is available on my public GitHub