April 25, 2020When generating code, you may need to instantiate a variable or a parameter with some placeholder value (On my end, I needed to assign values of base class’s constructor parameters). The easiest solution will be using the default literal. Or if you want to be more traditional and support older C# versions, using 0 for value types (except structs) and null for reference types will give the same result. But these approaches have some issues with method overloading.
Continue Reading →