public void Can_register_multiple_context_types_with_default_service_provider()
        {
            using (var context = new MultipleContext1(new DbContextOptions <MultipleContext1>()))
            {
                Assert.True(context.SimpleEntities.Any());
            }

            using (var context = new MultipleContext2(new DbContextOptions <MultipleContext2>()))
            {
                Assert.False(context.SimpleEntities.Any());
            }
        }
Exemplo n.º 2
0
        public void Can_register_multiple_context_types_with_default_service_provider()
        {
            using (SqlServerTestStore.GetNorthwindStore())
            {
                using (var context = new MultipleContext1(new DbContextOptions <MultipleContext1>()))
                {
                    Assert.True(context.Customers.Any());
                }

                using (var context = new MultipleContext2(new DbContextOptions <MultipleContext2>()))
                {
                    Assert.False(context.Customers.Any());
                }
            }
        }
        public void Can_register_multiple_context_types_with_default_service_provider()
        {
            using (SqlServerNorthwindContext.GetSharedStore())
            {
                using (var context = new MultipleContext1(new DbContextOptions<MultipleContext1>()))
                {
                    Assert.True(context.Customers.Any());
                }

                using (var context = new MultipleContext2(new DbContextOptions<MultipleContext2>()))
                {
                    Assert.False(context.Customers.Any());
                }
            }
        }