Auto generate dependency injection in .NET applications
You should install AutoDependencyInjection with NuGet:
Install-Package AutoDependencyInjection
Or via the .NET Core command line interface:
dotnet add package AutoDependencyInjection
public partial class Program
{
public readonly Foo _foo;
static void Main(string[] args)
{
}
}
When compile, following source will be injected.
public partial class Program
{
public readonly Foo _foo;
public Program(Foo foo)
{
_foo = foo
}
static void Main(string[] args)
{
}
}