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>());
精彩评论