Ejemplo n.º 1
0
        private ClassWithDependancies GetClassWithDependancies()
        {
            ClassWithInterface        classWithInterface        = new ClassWithInterface();
            ClassDependingOnInterface classDependingOnInterface = new ClassDependingOnInterface(classWithInterface);
            ClassWithDependancies     classWithDependancies     = new ClassWithDependancies(classDependingOnInterface);

            return(classWithDependancies);
        }
Ejemplo n.º 2
0
 private void ShowDIDemo(IServiceProvider appApplicationServices)
 {
     ClassWithDependancies viaConstructors = this.GetClassWithDependancies();
     //or
     ClassWithDependancies fromDi = appApplicationServices.GetService <ClassWithDependancies>();
 }