Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 641 Bytes

readme.md

File metadata and controls

31 lines (23 loc) · 641 Bytes

Build and push

Present [Inject] attribute.

This attribute is an easy way to make dependency injection via property or field.

It was better to use constructor injection. But some times when you can't use non-default constructor use this attribute.

[Inject] usage:

public class Foo
{
    [Inject]
    private IBar _bar;

    public Foo()
        => this.InjectProperties(App.Factory);
}
public class Foo
{
    [Inject]
    private IBar Bar { get; set; }

    public Foo()
        => this.InjectProperties(App.Factory);
}