rabehaja / IoC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Overriding Sitecore's default service provider with Unity.

Synopsis

A project to demonstrate how to override Sitecore's default Service Provider while staying as close as Sitecore as possible. Here I illustrate my approach on making it happen.
Note: This is not a must but just as an inspiration on how easy it is to get the job done.

Code Example

Motivation

I've seen some many ways to implement our own third party DI containers such as Unity, SimpleInjector, Ninject into Sitecore. Nevertheless, I've barely seen approaches which follow Sitecore's guideline regarding the matter. All the ways are good, but why not follow the conventions! :-)

Installation

This has been built based on Sitecore DLLs version 8.2.170728 and following the Helix convention.

  • Install it on an existing Helix friendly solution.
    • Fork the project.
    • Copy it in the Foundation Layer of your Helix based project.
    • Restore the nuget packages.
    • Reference it wherever you have to.
  • Install it on a Sandbox
    • Fork the project.
    • Restore the nuget packages.

Test

Contributor

License

About


Languages

Language:C# 88.3%Language:ASP 11.7%