9 lines
247 B
C#
9 lines
247 B
C#
|
|
using System.Linq.Expressions;
|
||
|
|
|
||
|
|
namespace SjkScripts.Helpers
|
||
|
|
{
|
||
|
|
public static class ActivatorCache<T> where T : new()
|
||
|
|
{
|
||
|
|
public static readonly Func<T> Create = Expression.Lambda<Func<T>>(Expression.New(typeof(T))).Compile();
|
||
|
|
}
|
||
|
|
}
|