More in this section

Forums / General Discussions / Dependency Injection

Dependency Injection

2 posts, 1 answered
  1. Preetham Reddy
    Preetham Reddy avatar
    57 posts
    Registered:
    16 Jul 2012
    27 Dec 2010
    Link to this post
    Hi,

    I am planning to use Dependency Injection in Sitefinity Project.  Does Sitefinity natively support DI? Is there any particular framework  you recommend to use with Sitefinity? I want to have some guidance on what  frameworks and how to use DI inside sitefinity.

    Thank you so much.

    --
    Preetham Reddy
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    28 Dec 2010
    Link to this post
    Hi Preetham,

    You can use ObjectFactory class - represents a static factory class for creating application objects and we have an internal method  RegisterIoCTypes which is called inside Container property of type IUnityContainer which defines the behavior of the dependency injection container. So, we use IUnityContainer and Interface Injection.

    Inside Application_Start event of Global.asax you can registers types with IoC framework.

    You can take a  look at

    Inject Some Life into Your Applications—Getting to Know the Unity
    Unity DI
    Documentation on codeplex

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
2 posts, 1 answered