I am working on code generation and ran into a snag with generics. Here is a \"simplified\" version of what is causing me issues.
Dictionary
A good and clean alternative, thanks to @LukeH's comment, is
using System;
using System.CodeDom;
using System.Collections.Generic;
using Microsoft.CSharp;
//...
private string GetFriendlyTypeName(Type type)
{
using (var p = new CSharpCodeProvider())
{
var r = new CodeTypeReference(type);
return p.GetTypeOutput(r);
}
}