AllTypes.FromAssemblyContaining(typeof(ARProductRepository)) .Where(x => isRepository(x)) .Configure(x => configureFowarding(x))
isRepository: verifies whether x implements a closed generic type derived from IRepository<> configureFowarding: checks if x implements another interface besides IRepository<> and calls x.Forward accordingly. On Fri, Feb 13, 2009 at 2:29 PM, gcores <[email protected]> wrote: > > Hi, > > I have a set of repository interfaces like this: > IRepository<> => ARRepository<> > IProductRepository => ARProductRepository > .... > where > IProductRepository : IRepository<Product> > ARPRoductRepòsitory : ARRepository<Product>. > > My problem is that when I ask for a IRepository<Product> it returns an > ARRepository<Product> instead of the ARProductRepository which I want. > > What I would like to know is, how do I have to register the components > in order to get this behavior? I know to do this for each repository, > i.e.: > Component.For<IProductRepository> > ().ImplementedBy<ARProductRepository>(). > Forward<IRepository<Product>>(); > but I want to do it using AllTypes. > Is there any way? > > Thanks, > > Gustavo Cores > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
