Sitecore Dependency Injection Part - 1
Introduction: In this Article we will try to see how we can implement Dependency Injection with examples. We will continue building on the the glass mapper sample created in our Previous blog. With Inheritance and Interface, we achieve loose coupling, but dependency injection (DI) take it one step ahead. in summary DI takes away all the mapping (which Interface will create which instance) at configuration level. Implementation: 1 - Setup IServicesConfigurator: First thing to do is create a IServicesConfigurator. At this point it is a bit tricky part. If this is for the first time you are adding " IServicesConfigurator ", You will get first error message stating reference need to be added for " Sitecore.DependencyInjection " after this, the warning Quigley line will still remain on " IServicesConfigurator ". If you hoverover it, you will see it states "needs Microsoft.Extensions.DependencyInjection to work but not installed". Here is the catc...