コード例 #1
0
 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
ファイル: CastleIoc.cs プロジェクト: kendarorg/Node.Cs.Old
		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");
		}