示例#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);
        }
 public static Registration AddType <TFrom, TTo>(this IObjectFactoryRegistry registry)
 {
     return(registry.RegisterType(typeof(TFrom), typeof(TTo), string.Empty));
 }
 public static Registration AddType(this IObjectFactoryRegistry registry, Type from, Type to)
 {
     return(registry.RegisterType(from, to, string.Empty));
 }