I'm trying to get a good understanding of dependency injection and I see in some cases (Blazor) that it is used at the beginning of the component:
@inject MyHtmlHelper Html
In other cases with the constructor which is the most common:
private readonly IMyHtmlHelper _html;
public MyClaseContructor(IMyHtmlHelper html)
{
_html = html;
}
and in other cases directly on a property:
[Inject]
public IMyHtmlHelper html {get; set;}
My doubt is if the 3 forms are the same or there are differences with the created instances. Thanks.