Relative Content

Tag Archive for blazorinject

Injecting a custom service into a hierarchy of components

I have a singleton service that I inject in _Imports.razor called ContactService. I also have a ContactForm component, ContactList component and a Contact component. ContactForm contains a ContactList. ContactList contains multiple Contacts. See this screenshot for the hierarchy:

Injecting a custom service into a hierarchy of components

I have a singleton service that I inject in _Imports.razor called ContactService. I also have a ContactForm component, ContactList component and a Contact component. ContactForm contains a ContactList. ContactList contains multiple Contacts. See this screenshot for the hierarchy: