Opennetcf IoC Calls my class's constructor twice
I have a class (named A) which uses another class (named B) as one of it's constructor's arguments by Openn开发者_开发知识库etcf's IoC Dependency Injection.
the problem is when my application starts , class B's constructor is called twice.
Class A's constructor :
[InjectionConstructor]
public MyService([CreateNew]ClassB classb)
{
_classb = classb;
}
I also load Class B by the "Load" method in the RootWorkItem collection.
any helps appreciated
I dont know this IoC Framework but your'e telling it that a object must be injected by the framework and you also state that the ClassB class needs to be created. So maybe that cause class b constructor to be called twice ? Once with the injector attribite and once with the createNew Attribute
精彩评论