c# - No matching bindings are available in multi layer architecture -
i development multi layer architecture , use ninject di container. how config bindngs in layers? ui > module > service / process > data / file layers try this:
public class configblog : ninjectmodule { public override void load() { this.bind<iblogsystemdata>().to<blogsystemdata>(); } }
blog config in service layer
public class configmodule : ninjectmodule { public override void load() { this.bind<iblogpostquery>().to<blogpostquery>(); this.bind<iblogpostanswerquery>().to<blogpostanswerquery>(); } }
config module confg blog service
//kernel.bind<dbcontext>().to<applicationdbcontext>().inrequestscope(); //kernel.bind<iforumsystemdata>().to<forumsystemdata>(); //kernel.bind<iforumpostquery>().to<forumpostquery>(); //kernel.bind<iforumpost>().to<forumpost>(); //kernel.bind<iforumpostanswer>().to<forumpostanswer>(); //var modules = new list<ininjectmodule> //{ // new configblog(), // new configcompany(), // new configdemo(), // new configevent(), // new configforum(), // new configgroup(), // new configmarketing(), // new configpage(), // new configpolicy(), // new configproduct(), // new configsolution(), // new configuser(), //}; //kernel.load(modules);
in ui layer.
Comments
Post a Comment