Stefan Sedich wrote:
interface IRepository<TKey, TEntity> { }
interface ICustomerRepository : IRepository<Guid, Customer> { }
class CustomerRepository : ICustomerRepository { }
container.Register(
AllTypes.FromAssembly(Assembly.GetExecutingAssembly())
.BasedOn(typeof(IRepository<,>)).WithService.FromInterface()
);
If I use that it registers CustomerRepository with the Service
IRepository<Guid, Customer>, although I worked out using
FromInterface(typeof(IRepository<,>)) it works
correctly for me, just curios as to why, unless I am just tired and
being a noob atm it seems like the same situation to me :)
What if you did:
interface IShouldBeRegistered {}
interface IRepository<TKey, TEntity>:IShouldBeRegistered { }
container.Register(
AllTypes.FromAssembly(Assembly.GetExecutingAssembly())
.BasedOn(typeof(IShouldBeRegistered)).WithService.FromInterface()
);
(that is, work around the generic type to determine if that is the cause
of your issue).
Thanks
Stefan
--
You received this message because you are subscribed to the Google
Groups "Castle Project Users" 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/castle-project-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "Castle
Project Users" 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/castle-project-users?hl=en.