Close
Skip to content

Softwareproduction

Software Development Blog, mainly C# and .NET

  • ASP.NET Core
  • Mobile Development
  • Code Generation
  • General Programming
  • Development Tools
  • Servers
  • Miscellaneous

Category: Code Generation

Picture by Isabelle Portes

Fast Conversion of Objects to Dictionaries in C#

February 28, 2018May 31, 2020Munir Husseini2 Comments

Converting (plain old) C# objects to dictionaries is easy with Reflection (e.g., as seen here). But Reflection is rather slow,…

Read More 18365 views

In-Memory Code Generation With .NET – Loading

May 2, 2015September 29, 2017Munir HusseiniNo Comments
This entry is part 5 of 5 in the series In-Memory Code Generation With .NET

The previous articles from this post series have discussed how to generate .NET types at runtime and how to get…

Read More 8716 views

Reflection Emit: Creating Properties

July 21, 2014September 27, 2017Munir Husseini1 Comment

For those who need to create a dynamic type in memory using Reflection.Emit and need to add some properties, here…

Read More 10706 views

Reflection Emit and Type Inheritance: Calling Base Type Constructors

July 21, 2014August 2, 2019Munir Husseini2 Comments

Suppose you want to use Reflection.Emit to generate a dynamic type in memory. Suppose this dynamic type should inherit a…

Read More 11884 views

Roslyn: Compile C# Expressions Without Using the Scripting API

May 23, 2014September 27, 2017Munir Husseini2 Comments

I have an application that processes table structures. Tables have columns and some columns may contain expressions. For example, an…

Read More 7696 views
Named Format with Linq Expressions

Fast Named Format With Linq Expressions

May 3, 2014September 29, 2017Munir Husseini7 Comments

This article describes how to implement “named format” functionality with C# and Linq Expressions. The .NET Framework supports string formats…

Read More 3245 views

ANTLR cannot generate ‘org.antlr.v4.codegen.CSharp_v4_5_1Target’ code as of version 4.1-SNAPSHOT

February 16, 2014Munir Husseini5 Comments

Today I tried to create an ANTLR 4 grammar and compile it to C#. Of course, I used Sam Harwell’s…

Read More 3158 views

Add A Namespace Import Via Visual Studio Automation

January 20, 2014Munir HusseiniNo Comments

Suppose you had a code document represented by a FileCodeModel object. And suppose you were modifying the containing DOM. Sometimes,…

Read More 1756 views

Use T4 Templates For XSLT Transformation

September 20, 2013Munir HusseiniNo Comments

Suppose you have XSLT style sheets that produce some code from XML files. Now suppose you want to integrate these…

Read More 3068 views

Linq Expressions By Sample: Calling Generic Methods With Lambda Parameters For Unknown Types

July 19, 2013Munir Husseini7 Comments

Suppose you need to call a generic Method that receives a generic delegate parameter. Now suppose that you neither know…

Read More 7664 views
Load More
(c) 2011-2020 Munir Husseini