Example #1
0
        protected override IKernel CreateKernel()
        {
            IKernel kernel = new StandardKernel(new DomainLayerDependencyModule(), new InfrastructureLayerDependencyModule());
            kernel.Load(Assembly.LoadFrom(@"C:\Users\DIEGO\YAM-CMS\MyCMS.Data\bin\Debug\MyCMS.Data.dll"));

            if (!kernel.HasModule("MyCMS.Data.Ninject.DataLayerDependencyModule"))
                throw new Exception("El módulo de dependencias 'PersistenceLayerDependencyModule' no está presente");

            if (!kernel.HasModule("MyCMS.Domain.Core.DomainLayerDependencyModule"))
                throw new Exception("El módulo de dependencias 'BusinessLayerDependencyModule' no está presente");

            return kernel;
        }
Example #2
0
        static void Main(string[] args)
        {
            IKernel kernel = new StandardKernel();
       
        kernel.Load("yourXmlFileName.xml");
               bool ismodule = kernel.HasModule("myXmlConfigurationModule");//To Check The module 

        var a=kernel.Get<InterfaceA>();
            a.Print();

            Console.Read();
        }