コード例 #1
0
        public void Creates_named_instances()
        {
            const string name = "test";

            _registry.RegisterType(typeof(ISimpleService), typeof(SimpleService), name);
            var o = _factory.GetInstance(typeof(ISimpleService), name);

            Assert.IsNotNull(o);
        }
コード例 #2
0
 public static Registration AddType <TFrom, TTo>(this IObjectFactoryRegistry registry)
 {
     return(registry.RegisterType(typeof(TFrom), typeof(TTo), string.Empty));
 }
コード例 #3
0
 public static Registration AddType(this IObjectFactoryRegistry registry, Type from, Type to)
 {
     return(registry.RegisterType(from, to, string.Empty));
 }