Here you will learn how Dependency Injection can be leveraged in Blazor
Most apps today are dependent on remote or built-in services. With
About Dependency Injection (DI)
In Short, dependency injection is a technique which delivers a key advantage, “loose coupling”. With DI, objects that have dependencies, don’t need to resolve them, rather the dependencies are resolved for them by injecting them into the object when they are created.
DI in Blazor
Adding Services to the DI
Just like any normal .NET Core app, we will setup our DI in the
Startup.cs file, inside the method
To Demonstrate DI we will create a little to-do app that will display and add todos, displaying them in the page.