开发者

Castle Facility using non default constructor in registration

I am trying to register a facility in Castle Windsor using the fluent apis (version 2.5.1). I am also trying to use a non default constructor (one that takes parameters). My current code looks like this:

  IWindsorConatiner c= new 开发者_StackOverflowContainer();
  c.AddFacility<NHibernateFacility>();

The NHibernateFacility has another constructor, how do I tell Castle to use it instead?

/Konstantin


c.AddFacility("nh", new NHibernateFacility(...));

where "nh" is the id of the facility in the config.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜