Tech Tutorials Database
GeekArticles Microsoft C#
 

Alternative to Activator.CreateInstance

 
Author: codeproject.com
Category: C#
Comments (0)

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...

Read More...




Sponsored Links




Read Next: C# Queue Implementation


 

 

Comments



Post Your Comment:

Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe