views:

75

answers:

2

Hi, this is my code in Global.asax

 WindsorContainer container = new WindsorContainer();
container.Register(Component.For(typeof(IRepository<>))
                                       .ImplementedBy(typeof(NHRepository<>))
                                       .LifeStyle.Transient)

I've tried to translate it in a xml config file with this but didn't work

<component id="NHRepository"
           service="NCommon.Data.IRepository'1, NCommon"
           type="NCommon.Data.NHibernate.NHRepository'1, NCommon.NHibernate"
           lifestyle="transient">
</component>

How can I convert this code in a config file as Windsor.config ?

Tanks Mirko

A: 

See this other question

Ahmad
Not related....
Mauricio Scheffer
+2  A: 

You need to use backticks, not apostrophes

<component id="NHRepository"
           service="NCommon.Data.IRepository`1, NCommon"
           type="NCommon.Data.NHibernate.NHRepository`1, NCommon.NHibernate"
           lifestyle="transient">
</component>
Mauricio Scheffer
Good one. I didn't notice it ;)
Krzysztof Koźmic

related questions