I've got the following definition:
public class ManageMembershipAuthoriser :
IAuthorise<AddGroupToGroupMessage>,
IAuthorise<RemoveGroupFromGroupMessage>
To register all types that implement IAuthorise<> I've done the
following Installer:
public class AuthorisersInstaller : IWindsorInstaller
{
public void Install(IWindsorContainer container,
IConfigurationStore
store)
{
var executingLocation =
ReflectionUtils.GetExecutingLocation();
var assemblies = Directory.GetFiles(executingLocation,
"SWAT.*.dll", SearchOption.AllDirectories);
foreach (var assembly in assemblies)
{
container.Register(AllTypes
.FromAssemblyNamed(Path.GetFileNameWithoutExtension(assembly))
.BasedOn(typeof(IAuthorise<>)).WithService.Base()
.Configure(registration =>
registration.LifeStyle.Transient));
}
}
}
But this only registers the first interface right?
So I think I need to use both WithService.AllInterfaces() +
WithService.Base().
Something
like:
.BasedOn(typeof(IAuthorise<>)).WithService.Base().WithService.AllInterfaces()
Is this right and will this work?
Cheers
John
--
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.