T4WebFormsInjection 0.1.0
See the version list below for details.
dotnet add package T4WebFormsInjection --version 0.1.0
NuGet\Install-Package T4WebFormsInjection -Version 0.1.0
<PackageReference Include="T4WebFormsInjection" Version="0.1.0" />
paket add T4WebFormsInjection --version 0.1.0
#r "nuget: T4WebFormsInjection, 0.1.0"
// Install T4WebFormsInjection as a Cake Addin #addin nuget:?package=T4WebFormsInjection&version=0.1.0 // Install T4WebFormsInjection as a Cake Tool #tool nuget:?package=T4WebFormsInjection&version=0.1.0
T4 WebForms Injection generates default parameterless constructors for asp.net pages, user controls, handlers and modules. It is DI container independant with the only requirement being that a container (or method to it) is accesible statically.
While not a true dependency injection framework, it does have the added benefit of not having any additional overhead of replacing the asp.net factories and by its nature will work without exception.
The package consists of a T4 template that will scan the current project for configurable class descendants with a parameterised constructor and then generate a default constructor which will call the parameterised constructor with instantiated objects created by the designated DI framework.
Example:
In Default.aspx.cs:
public partial class _Default : Page
{
public _Default(ISomething something)
{
...
}
}
In T4 generated template:
public partial class _Default
{
public _Default()
: this(ObjectFactory.GetInstance<IDoSomething>())
{
...
}
}
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on T4WebFormsInjection:
Package | Downloads |
---|---|
Bnsights.Coreib
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.