public DefaultController(Service1 s1, Service2 s2, Service3 s3, DefaultBusiness defaultBiz) { this.s1 = s1; this.s2 = s2; this.s3 = s3; this.defaultBiz = defaultBiz; }
public HomeController(Service1 service1, Service2 service2, Service3 service3, ISomeService someService) { _service1 = service1; _service2 = service2; _service3 = service3; _someService = someService; }
public Service2(Service3 service3) { if (service3 == null) throw new ArgumentNullException("service3"); this.Service3 = service3; }
public int CalculComplexeImportant() { Service1 s1 = new Service1(); Service2 s2 = new Service2(); Service3 s3 = new Service3(); return(s1.GetMontantComplexe() + s2.GetAutreMontantComplexe() + s3.GetEncoreUnAutreMontantComplexe()); }
public Service2(Service3 service3) { if (service3 == null) { throw new ArgumentNullException("service3"); } this.Service3 = service3; }
private void button5_Click(object sender, EventArgs e) { try { Service3 webservice = new Service3(); textBox6.Text = webservice.Transliteration(textBox5.Text); webservice.Dispose(); } catch (Exception ex) { textBox6.Text = ex.Message; } }
public Send_a_single_message_to_the_correct_node() { Website1.Registry.Channel(x => x.Service1) .AcceptsMessage <OneMessage>(); Service1.Handles <OneMessage>(); Service2.Handles <OneMessage>(); Service3.Handles <OneMessage>(); Website1.Sends <OneMessage>("first message").ShouldBeReceivedBy(Service1); }
private void button6_Click(object sender, EventArgs e) { try { Service3 webservice = new Service3(); MessageBox.Show(webservice.AppointmentPlugin()); webservice.Dispose(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public IndexModel(Service2 service2, Service3 service3, IService service, IFoo foo, IBar bar, INewService newService, IOtherService otherService, IOtherService2 otherService2) { Service2 = service2 ?? throw new System.ArgumentNullException(nameof(service2)); Service3 = service3 ?? throw new System.ArgumentNullException(nameof(service3)); Service = service ?? throw new System.ArgumentNullException(nameof(service)); Foo = foo ?? throw new System.ArgumentNullException(nameof(foo)); Bar = bar ?? throw new System.ArgumentNullException(nameof(bar)); NewService = newService ?? throw new System.ArgumentNullException(nameof(newService)); OtherService = otherService ?? throw new System.ArgumentNullException(nameof(otherService)); OtherService2 = otherService2 ?? throw new System.ArgumentNullException(nameof(otherService2)); }
private void button3_Click(object sender, EventArgs e) { try { Service3 webservice = new Service3(); textBox9.Text = webservice.MultiplicationOctalNumbers(textBox7.Text, textBox8.Text); webservice.Dispose(); } catch (Exception ex) { textBox9.Text = ex.Message; } }
public Send_a_single_message_to_multiple_listening_nodes() { Website1.Registry.Channel(x => x.Service1) .AcceptsMessage <OneMessage>(); Website1.Registry.Channel(x => x.Service3) .AcceptsMessage <OneMessage>(); Service1.Handles <OneMessage>(); Service2.Handles <OneMessage>(); Service3.Handles <OneMessage>(); Service4.Handles <OneMessage>(); Website1.Sends <OneMessage>("first message") .ShouldBeReceivedBy(Service1) .ShouldBeReceivedBy(Service3); }
public void Resolve_InterfacesAcrossInChildContainer_Resolves() { var container = UtilityMethods.GetContainer(); container.Register<IService2, Service2>().AsMultiInstance(); container.Register<IService4, Service4>().AsMultiInstance(); container.Register<IService5, Service5>().AsMultiInstance(); var child = container.GetChildContainer(); var nestedService = new Service3(); child.Register<IService3>(nestedService); var service5 = child.Resolve<IService5>(); Assert.IsNotNull(service5.Service4); Assert.AreSame(nestedService, service5.Service4.Service2.Service3); }
public void Resolve_InterfacesAcrossInChildContainer_Resolves() { var container = UtilityMethods.GetContainer(); container.Register <IService2, Service2>().AsMultiInstance(); container.Register <IService4, Service4>().AsMultiInstance(); container.Register <IService5, Service5>().AsMultiInstance(); var child = container.GetChildContainer(); var nestedService = new Service3(); child.Register <IService3>(nestedService); var service5 = child.Resolve <IService5>(); Assert.IsNotNull(service5.Service4); Assert.AreSame(nestedService, service5.Service4.Service2.Service3); }
public DIOperateController( IOperationTransient transient, IOperationScoped scope, IOperationSingleton singleton, IJob job, IOperationSingletonInstance instance, OperationService operationService, Service1 service1, ISomeService someService, Service3 service3, IFly fly ) { this._transient = transient; this._scope = scope; this._singleton = singleton; this._job = job; this._instance = instance; this._operationService = operationService; this._service1 = service1; this._someService = someService; this._service3 = service3; this._fly = fly; }
public void OnPost() { try { if (Upload1 != null) { var fileName = Service1.SaveFile(_environment, Upload1); var data = Service2.ReadExcelFile("sheet1", fileName); //var result = Method.GetListOfTransactions(data); ResultsTasviye = Service3.GetListOfTransactions(data); } if (Upload2 != null) { var fileName = Service1.SaveFile(_environment, Upload2); var data = Service2.ReadExcelFile("sheet1", fileName); ResultsTasviyeKhorgin = Service4.GetListOfTransactionskhorgin(data); ResultsTasviyeKhorgin.Count(); } } catch (Exception exp) { throw exp; } }
public DefaultBusiness(Service1 s1, Service2 s2, Service3 s3) { this.s1 = s1; this.s2 = s2; this.s3 = s3; }
public void Add_WeaveTest3() { Service1 s1 = new Service1(); Service3 s3 = new Service3(); Service4 s4 = new Service4(); ew.Add(s1); ew.Add(s3); ew.Add(s4); s1.Trigger(); Assert.AreEqual(1, s3.EventCount); Assert.AreEqual(1, s4.Event1Count); Assert.AreEqual(1, s4.Event2Count); }
public void Snapshot() { var services = new ServiceContainer(); var service1 = new Service1(); var service2 = new Service2(); var service3 = new Service3(); var snapshot = services.BuildServiceProvider(); Assert.Empty(services); services.AddSingleton <IService1>(service1); services.AddSingleton <IService2>(service2); Assert.Equal(2, services.Count); Assert.Same(service1, services.GetService <IService1>()); Assert.Same(service2, services.GetService <IService2>()); Assert.Null(services.GetService <IService3>()); Assert.Throws <InvalidOperationException>(() => services.GetRequiredService <IService3>()); // These should all return NULL because the snapshot was // taken before the services were added. Assert.Null(snapshot.GetService <IService1>()); Assert.Null(snapshot.GetService <IService2>()); Assert.Null(snapshot.GetService <IService3>()); // Get a new snapshot and test again. snapshot = services.BuildServiceProvider(); Assert.Same(service1, services.GetService <IService1>()); Assert.Same(service2, services.GetService <IService2>()); Assert.Null(snapshot.GetService <IService3>()); // Make sure that the [ServicesContainer] is still returning // the correct services. Assert.Same(service1, services.GetService <IService1>()); Assert.Same(service2, services.GetService <IService2>()); Assert.Null(services.GetService <IService3>()); Assert.Throws <InvalidOperationException>(() => services.GetRequiredService <IService3>()); // Add a third service and verify the [ServicesContainer]. services.AddSingleton <IService3>(service3); Assert.Equal(3, services.Count); Assert.Same(service1, services.GetService <IService1>()); Assert.Same(service2, services.GetService <IService2>()); Assert.Same(service3, services.GetService <IService3>()); // The new service shouldn't be in the last snapshot. Assert.Null(snapshot.GetService <IService3>()); // Get a new snapshot and verify all three services. snapshot = services.BuildServiceProvider(); Assert.Same(service1, services.GetService <IService1>()); Assert.Same(service2, services.GetService <IService2>()); Assert.Same(service3, services.GetService <IService3>()); }
public Service2(Service3 service3) { _service3 = service3; }
public TestController(Service1 service1, Service2 service2, Service3 service3) { _service1 = service1; _service2 = service2; _service3 = service3; }
public PingController(Service1 service1, Service2 service2, Service3 service3) { Service1 = service1; Service2 = service2; Service3 = service3; }
public Service(Func <object, ILogger> getLogger, Service1 s1, Service2 s2, Service3 s3) => _logger = getLogger(this);
public SomeQuoteProcessor1(Service1 service1, Service3 service3) : base(service1, service3) { }