Example #1
0
 private void AddService(LayeredCompositeAssembler assembler, String serviceID)
 {
     ((ServiceCompositeAssemblyDeclaration)assembler.NewLayeredService()
      .VisibleIn(Visibility.MODULE)
      .OfTypes(typeof(TestService)))
     .SetActivateWithApplication(true)
     .Use(serviceID)
     ;
 }
        protected override void Assemble(LayeredCompositeAssembler assembler)
        {
            assembler.NewLayeredService().VisibleIn(Visibility.APPLICATION).OfTypes(typeof(TestService));
            var architecture   = (LayeredArchitecture)assembler.ApplicationArchitecture;
            var serviceLayer   = architecture.GetOrCreateLayer(LAYER_NAME);
            var midLayer       = architecture.GetOrCreateLayer("MidLayer");
            var transientLayer = architecture.GetOrCreateLayer("TransientLayer");

            transientLayer.GetOrCreateModule("TransientModule").CompositeAssembler.NewPlainComposite().OfTypes(typeof(TestComposite));

            transientLayer.UseLayers(midLayer);
            midLayer.UseLayers(serviceLayer);
        }