Create objects using a public or a non-public constructor.
- Simple to use
- High performance reflection
- No external dependencies
- Over
10x
faster thanActivator
from System namespace - Option to use a private constructor with parameters
dotnet add package FOF
Package is hosted on NuGet.
Example class which has constructor with parameters.
public class ExampleClass
{
public string String { get; }
public int Int { get; }
private ExampleClass(string @string, int @int)
{
String = @string;
Int = @int;
}
}
An example of using a Factory
.
Factory<ExampleClass>.Create("Text", 1);