On Fri, Jun 19, 2009 at 5:11 PM, Kris-I<[email protected]> wrote:
>
> I have this error
> failed: No component for supporting the service
> Rhino.Commons.IRepository`1[[Planning.Core.DomainModel.Employee,
> Planning.Core.DomainModel, Version=1.0.0.0, Culture=neutral,
> PublicKeyToken=null]] was found
>
> [snip]
>
> container.AddComponent<IUnitOfWorkFactory,
> NHibernateUnitOfWorkFactory>();
>
Looks like you need to register NHRepository<T> with the container.
I'm not inclined to try the "in-code syntax" without my compiler, but
you would do that in windsor.config like this...
<component
id="repository"
service="Rhino.Commons.IRepository`1, Rhino.Commons.NHibernate"
type="Rhino.Commons.NHRepository`1, Rhino.Commons.NHibernate" />
When you invoke a method on Repository<T>, it will tell the container
to resolve IRepository<T> (IRepository<Employee> in this case), and
you want that to resolve to NHRepository<T>.
HTH,
--Stuart
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Rhino Tools Dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rhino-tools-dev?hl=en
-~----------~----~----~----~------~----~------~--~---