Skip to content

Latest commit

 

History

History
37 lines (28 loc) · 918 Bytes

README.md

File metadata and controls

37 lines (28 loc) · 918 Bytes

logo-FOF

Fast Object Factory 🏭

Create objects using a public or a non-public constructor.

Benefits:

  • Simple to use
  • High performance reflection
  • No external dependencies
  • Over 10x faster than Activator from System namespace
  • Option to use a private constructor with parameters

Installation

dotnet add package FOF

Package is hosted on NuGet.

Example

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);