Blog Posts with Tag Roslyn

Metaprogramming in .NET: Building a Source Generator for a Factory Pattern with Roslyn

In every project there is boilerplate code. It is a particular evil more seen in statically typed languages with the need to express every object in a type safe way. In this post I'm going to be talking about building a Source Generator with Roslyn to auto generate some of this boilerplate. More specifically I'll be auto generating a factory for an object based off a constructor. What's a Factory A factory is a design pattern focused on creating objects. While factories have…

July 29, 2022
|
approximately 4 minutes to read
© 2024 - Built and designed by Jeremy Honl with Gatsby. Images are from Unsplash