private void RegisterCommandHandlers(IWindsorContainer container, FromAssemblyDescriptor descriptor)
 {
     container.Register(descriptor
         .BasedOn(typeof (ICommandHandler<>))
         .WithServiceAllInterfaces()
         .WithServiceSelf()
         .Configure(c =>
         {
             c.Named($"{c.Implementation.FullName} (fallback)");
             c.IsFallback();
         }).LifestyleTransient());
 }
예제 #2
0
		private BasedOnDescriptor InitializeSelection(IClass classs, FromAssemblyDescriptor componentFor)
		{
			if (classs.Where != null)
			{
				return componentFor.Where(a=>classs.Where(a));
			}
			if (classs.BasedOn != null)
			{
				return componentFor.BasedOn(classs.BasedOn).WithServiceAllInterfaces();
			}
			throw new ContainerException("Implementation not allowed for component");
		}