something like
Kernel.Register(
AllTypes.FromAssembly(Assembly.GetExecutingAssembly())
.BasedOn(typeof(IValidatorOf<>))
.WithService.Select((t,b) => t.GetInterfaces())
.Configure(delegate(ComponentRegistration c)
{
c.LifeStyle.Is(LifestyleType.Transient);
}),
);
On Wed, Sep 3, 2008 at 10:27 AM, Jan Limpens <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> this test meets my expectations:
>
> [TestFixture]
> public class KernelTests
> {
> [Test]
> [ExpectedException(typeof(ComponentNotFoundException))]
> public void KernelDoesNotResolveEntitiesBySubInterface()
> {
> var container = new WindsorContainer();
> container.Register(Component.For<IFoo>().ImplementedBy<Sut>());
> container.Resolve<IFooX>();
> }
>
> public class Sut : IFooX, IBar { }
> public interface IFooX : IFoo { }
> public interface IFoo { }
> public interface IBar { }
> }
>
> but is there a way to tell the container to also register all (or
> some) other interfaces a (group of) class subscribe to?
> In my case I want to register a whole bunch of validators that
> implement IValidator<T> : IValidator.
> I would like to avoid to have to register all of them one by one. I
> might forget one. On the other hand I cannot resolve them by
> IValidator, because that would remove their meaning of live.
>
> --
> Jan
> ___________________
> [EMAIL PROTECTED]
> www.limpens.com
> +55 (11) 3082-1087
> +55 (11) 3097-8339
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---