Beispiel #1
0
        public static EntityObjectStoreConfiguration EntityObjectStoreConfig()
        {
            var config = new EntityObjectStoreConfiguration();

            config.UsingCodeFirstContext(() => new ExampleDbContext("NakedObjectsTemplate", new ExampleDbInitializer()));
            return(config);
        }
        public static EntityObjectStoreConfiguration EntityObjectStoreConfig()
        {
            var config = new EntityObjectStoreConfiguration();

            config.UsingCodeFirstContext(() => new AdventureWorksContext());
            return(config);
        }
Beispiel #3
0
        public static EntityObjectStoreConfiguration EntityObjectStoreConfig()
        {
            var config = new EntityObjectStoreConfiguration();

            config.UsingCodeFirstContext(() => new CodeFirstContext("RestTest"));
            return(config);
        }
Beispiel #4
0
        public static EntityObjectStoreConfiguration EntityObjectStoreConfig()
        {
            var config = new EntityObjectStoreConfiguration();

            config.UsingCodeFirstContext(() => new AdventureWorksContext());
            config.SpecifyTypesNotAssociatedWithAnyContext(() => new[] { typeof(PropertyViewModel), typeof(FindViewModel) });
            return(config);
        }
        public static EntityObjectStoreConfiguration EntityObjectStoreConfig(IConfiguration configuration)
        {
            var config = new EntityObjectStoreConfiguration();
            var cs     = configuration.GetConnectionString("AdventureWorksContext");

            config.UsingCodeFirstContext(() => new AdventureWorksContext(cs));
            return(config);
        }
        protected override void RegisterTypes(IUnityContainer container)
        {
            base.RegisterTypes(container);
            var config = new EntityObjectStoreConfiguration {
                EnforceProxies = false
            };

            config.UsingCodeFirstContext(() => new MvcTestContext("SystemHelperTest"));
            container.RegisterInstance <IEntityObjectStoreConfiguration>(config, (new ContainerControlledLifetimeManager()));
        }
        protected override void RegisterTypes(IUnityContainer container)
        {
            base.RegisterTypes(container);
            var config = new EntityObjectStoreConfiguration {
                EnforceProxies = false
            };

            config.UsingCodeFirstContext(() => Activator.CreateInstance <TContext>());
            container.RegisterInstance(config, (new ContainerControlledLifetimeManager()));
        }
        protected override void RegisterTypes(IUnityContainer container)
        {
            base.RegisterTypes(container);
            var config = new EntityObjectStoreConfiguration {
                EnforceProxies = false
            };

            config.UsingCodeFirstContext(() => new PolymorphicNavigationContext(databaseName));
            container.RegisterInstance <IEntityObjectStoreConfiguration>(config, (new ContainerControlledLifetimeManager()));
            container.RegisterType <IMenuFactory, ReflectorTest.NullMenuFactory>();
        }
        protected override void RegisterTypes(IUnityContainer container)
        {
            base.RegisterTypes(container);
            var config = new EntityObjectStoreConfiguration {
                EnforceProxies = false
            };

            config.UsingCodeFirstContext(() => new AdventureWorksContext());
            container.RegisterInstance <IEntityObjectStoreConfiguration>(config, (new ContainerControlledLifetimeManager()));

            container.RegisterType <IFrameworkFacade, FrameworkFacade>(new PerResolveLifetimeManager());
            container.RegisterType <IOidStrategy, EntityOidStrategy>(new PerResolveLifetimeManager());
            container.RegisterType <IOidTranslator, OidTranslatorSemiColonSeparatedList>(new PerResolveLifetimeManager());
        }
        protected override void RegisterTypes(IUnityContainer container)
        {
            base.RegisterTypes(container);
            // replace INakedObjectStore types
            var c = new EntityObjectStoreConfiguration();

            c.UsingCodeFirstContext(() => new TestContext("TestContext"));
            container.RegisterInstance <IEntityObjectStoreConfiguration>(c, new ContainerControlledLifetimeManager());

            var types = new[] { typeof(TestDomainObject[]), typeof(List <TestDomainObject>), typeof(ObjectQuery <TestDomainObject>), typeof(List <Int32>) };
            var ms    = new[] { typeof(SimpleRepository <TestDomainObject>) };
            var ns    = new[] { typeof(TestDomainObject).Namespace };
            var rc    = new ReflectorConfiguration(types, ms, ns);

            container.RegisterInstance <IReflectorConfiguration>(rc, new ContainerControlledLifetimeManager());
        }
 public static EntityObjectStoreConfiguration EntityObjectStoreConfig()
 {
     var config = new EntityObjectStoreConfiguration();
     config.UsingCodeFirstContext(() => new ExampleDbContext("NakedObjectsExample"));
     return config;
 }