コード例 #1
0
        private void RegisterPropertyInjection()
        {
            IServiceA serviceA = new ServiceA();
            IServiceB serviceB = new ServiceB();
            IServiceC serviceC = new ServiceC();

            this.container[typeof(IComplexPropertyObject)] = () =>
                new ComplexPropertyObject
                {
                    ServiceA = serviceA,
                    ServiceB = serviceB,
                    ServiceC = serviceC,
                    SubObjectA = new SubObjectA { ServiceA = serviceA },
                    SubObjectB = new SubObjectB { ServiceB = serviceB },
                    SubObjectC = new SubObjectC { ServiceC = serviceC }
                };
        }
コード例 #2
0
 public IServiceA ProvideServiceA(ServiceA service)
 {
     return service;
 }