Just something that is bugging me, why do I need to do the following:

Say I have

interface IRepository { }
interface ICustomerRepository : IRepository { }
class CustomerRepository : ICustomerRepository { }

If I use:

container.Register(
                AllTypes.FromAssembly(Assembly.GetExecutingAssembly())
                    .BasedOn<IRepository>().WithService.FromInterface()
                );

This will correctly register the CustomerRepostory with the service
ICustomerRepository.


But say I have

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 :)


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.

Reply via email to