GeekArticles
Microsoft
C#
Microsoft
C#Alternative to Activator.CreateInstance
Using expressions, you can achieve a faster result with less code.public static T New(){ Type t = typeof(T); Func method = Expression.Lambda>(Expression.Block(t, new Expression[] { Expression.New(t) })).Compile(); return method();}Furthermore, this can...
Sponsored Links
Related Topics
