public string GetData(int a)
    {
        ValueForB = a * new Random().Next();
        _anotherServiceImplementation = b;
        var processA = new ProcessA(_anotherServiceImplementation);

        return(processA.Run());
    }
 public MyFunction(
     IMyService myService,
     IAnotherService anotherService,
     INestedService nestedService)
 {
     this.myService      = myService;
     this.anotherService = anotherService;
     this.nestedService  = nestedService;
 }
Beispiel #3
0
 public ValuesController(
     ISomeService service,
     IAnotherService anotherService,
     ILogger <ValuesController> logger)
 {
     _service        = service;
     _anotherService = anotherService;
     _logger         = logger;
 }
        public void TransientComponents()
        {
            String contents =
                "import Castle.Facilities.AspectSharp.Tests.Components in Castle.Facilities.AspectSharp.Tests " +
                "import Castle.Facilities.AspectSharp.Tests.Interceptors in Castle.Facilities.AspectSharp.Tests " +
                " " +
                " aspect MyAspect for AnotherService " +
                "   " +
                "   pointcut method|property(*)" +
                "     advice(LoggerInterceptor)" +
                "   end" +
                "   " +
                " end ";

            MutableConfiguration config = new MutableConfiguration("facility", contents);

            DefaultConfigurationStore store = new DefaultConfigurationStore();

            store.AddFacilityConfiguration("aop", config);

            WindsorContainer container = new WindsorContainer(store);

            container.AddFacility("aop", new AspectSharpFacility());

            container.AddComponent("interceptor1", typeof(CastleSimpleInterceptor));
            container.AddComponent("comp1", typeof(SimpleService));
            container.AddComponent("comp2", typeof(IAnotherService), typeof(AnotherService));

            for (int i = 1; i < 10000; i++)
            {
                LoggerInterceptor.Messages.Length = 0;

                IAnotherService service = container[typeof(IAnotherService)] as IAnotherService;
                service.Name = "hammett";
                service.StartWork();

                Assert.AreEqual("Enter set_Name\r\nEnter StartWork\r\n",
                                LoggerInterceptor.Messages.ToString());

                CastleSimpleInterceptor interceptor =
                    container[typeof(CastleSimpleInterceptor)] as CastleSimpleInterceptor;

                Assert.AreEqual(2 * i, interceptor.Executions);
            }
        }
 public ProcessA(IAnotherService anotherService)
 {
     _anotherService = anotherService;
 }
Beispiel #6
0
 public MyService(IAnotherService anotherService)
 {
     _anotherService = anotherService;
 }
 public DependentConsumer(IService service, IAnotherService anotherService)
 {
     _service        = service;
     _anotherService = anotherService;
 }
Beispiel #8
0
        public Product Update([FromBody] UpdateProductRequest model, [FromServices] IAnotherService anotherService)
        {
            var result = _productService.Update(model);

            return(result);
        }
Beispiel #9
0
 public MyFirstService(IAnotherService anotherService)
 {
     _anotherService = anotherService;
 }
 public Class(IService service, IAnotherService anotherService)
 {
     this.service        = service;
     this.anotherService = anotherService;
 }
Beispiel #11
0
 public Service(IAnotherService anotherService)
 {
     AnotherService = anotherService;
 }
 public UsersController(IAnotherService svc)
 {
     this.svc = svc;
 }
Beispiel #13
0
 public TestClass(ISomeService someService, IAnotherService anotherService) : base(someService, anotherService)
 {
 }
 public Service1Consumer(IAnotherService service)
 {
     _anotherServiceImplementation = service;
 }
Beispiel #15
0
 public SystemUnderTest(IUserDialogs userDialogs, IAnotherService anotherService)
 {
     this.userDialogs    = userDialogs;
     this.anotherService = anotherService;
 }
Beispiel #16
0
 public Service(IAnotherService anotherService)
 {
     AnotherService = anotherService;
 }
Beispiel #17
0
 public SomeService(IAnotherService anotherService)
 {
     _anotherService = anotherService;
 }