Since version 8, Sitecore has started focusing on cleaner and extensible architecture with more and more plug and play features. One key improvement in version 8 was introducing dependency injection within Sitecore based on .net core libraries for DI. So if you are creating an application in Sitecore and planning to use DI, you can always make use of inbuilt DI used by Sitecore. Obvious advantage is you wont be introducing any new paths in the solution and no new libraries will be introduced keeping the solution lightweight. So, the obvious question - how do we do it? I am assuming here that you have basic understanding of a Sitecore application and dependency injection fundamentals. Hence, I will focus on steps needed to enable DI in Sitecore. Include the following DLLs to references in your project (in Foundation layer if you are following Helix principles) - Microsoft.Extensitons.DependencyInjection, Microsoft.Extensions.DependencyInjection.Abstraction Cre...
Welcome to Sitecore Docs Blog! This blog shares expert tips, best practices, and innovative solutions for your Sitecore application. This blog aims to offer in-depth tutorials, insightful articles, and practical advice to help you master Sitecore’s powerful features. From optimizing performance to crafting custom solutions, this blog can help you to empower your Sitecore journey with the knowledge and tools. Happy reading!