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; }
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; }
public MyService(IAnotherService anotherService) { _anotherService = anotherService; }
public DependentConsumer(IService service, IAnotherService anotherService) { _service = service; _anotherService = anotherService; }
public Product Update([FromBody] UpdateProductRequest model, [FromServices] IAnotherService anotherService) { var result = _productService.Update(model); return(result); }
public MyFirstService(IAnotherService anotherService) { _anotherService = anotherService; }
public Class(IService service, IAnotherService anotherService) { this.service = service; this.anotherService = anotherService; }
public Service(IAnotherService anotherService) { AnotherService = anotherService; }
public UsersController(IAnotherService svc) { this.svc = svc; }
public TestClass(ISomeService someService, IAnotherService anotherService) : base(someService, anotherService) { }
public Service1Consumer(IAnotherService service) { _anotherServiceImplementation = service; }
public SystemUnderTest(IUserDialogs userDialogs, IAnotherService anotherService) { this.userDialogs = userDialogs; this.anotherService = anotherService; }
public Service(IAnotherService anotherService) { AnotherService = anotherService; }
public SomeService(IAnotherService anotherService) { _anotherService = anotherService; }