Exemple #1
0
        public void Should_filter_out_get_property_methods()
        {
            var factory     = new ContextTypeFactory(new ExtensionMethodHandler(new AssemblyRegistry()));
            var contextType = factory.GetWrapper(typeof(TypeWithProperty));

            contextType.MemberMatchers.Any(x => x.MemberInfo.Name == "get_Foo").ShouldEqual(false);
        }
        public void Prepare(ContainerBuilder builder)
        {
            //制作临时上下文对象
            var tempType = ContextTypeFactory.GetProxyType(m_useOnConfiguring, m_useOneModelCreatingDel, m_useKeyFilter);

            //初始化数据库结构
            using (var tempContext = Activator.CreateInstance(tempType) as AutoContext)
            {
                tempContext.InitDB();
            }

            //注册为请求实例
            builder.RegisterType(tempType).As(typeof(AutoContext)).InstancePerLifetimeScope();
        }
Exemple #3
0
 public StepProvider(AssemblyRegistry assemblyRegistry, ContextTypeFactory typeFactory)
 {
     _assemblyRegistry = assemblyRegistry;
     _typeFactory      = typeFactory;
 }