コード例 #1
0
 public void AddServiceWithCallback()
 {
     using (TestContainer testContainer = new TestContainer())
     {
         testContainer.AddService(typeof(SayHelloService), new ServiceCreatorCallback(SayHelloServiceCreatorCallback));
         Assert.AreEqual(1, testContainer.services.Count);
         SayHelloService sayHello = testContainer.GetService(typeof(SayHelloService)) as SayHelloService;
         Assert.IsNotNull(sayHello);
         Assert.IsTrue(serviceCallbackExecuted);
     }
 }
コード例 #2
0
 public string SayHello([Service(ServiceKind.Pooled)] SayHelloService service)
 => service.SayHello();
コード例 #3
0
 public string SayHello([Service(ServiceKind.Resolver)] SayHelloService service)
 => service.SayHello();
コード例 #4
0
 public string SayHello([Service] SayHelloService service)
 => service.SayHello();
コード例 #5
0
 public string SayHello([Service(ServiceKind.Synchronized)] SayHelloService service)
 => service.SayHello();