Skip to content
/ FOF Public

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

License

Notifications You must be signed in to change notification settings

adimiko/FOF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages