开发者

How to wireup a class that doesn't have an interface

I have a class that just has public properties of services that are already wired up in Windsor.

How can I 开发者_JS百科register this class?

I only know this pattern:

 container.Register(Component.For(typeof (IRepository<>))
                    .ImplementedBy(typeof (Repository<>)));

But this class doesn't have an interface, it is the implementation. I am only looking to set this up so the properties are preconfigured when I instantiate it.


container.Register(Component.For(typeof(Repository<>)));

or for closed types:

container.Register(Component.For<MyConcreteType>());
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜