Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class Factory<T> : IFactory<T>
{
private readonly Func<T> _initFunc;
public Factory(Func<T> initFunc)
{
_initFunc = initFunc;
}
public T Create()
{
return _initFunc();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment