Inject Classes
Use Zenject Dependency Injection
Constructor Injection
internal class DependencyInjectionExample
{
private EasyEvents _events;
public DependencyInjectionExample(EasyEvents events)
{
_events = events;
}
}Method Injection
1. Have a private variable that is assigned via method injection and used throughout your class. Injected only once.
2. Inject the class into every method that needs. Injected into every class with [Inject] attribute
Last updated