internal static IEdmModel CreateEdmModel()
        {
            IEdmModel orderEdmModel  = new OrderDataAdapter().BuildEdmModel();
            IEdmModel order2EdmModel = new Order2DataAdapter().BuildEdmModel(orderEdmModel);

            ExecuteBatchAsync(order2EdmModel, "Add").GetAwaiter().GetResult();
            ExecuteBatchAsync(orderEdmModel, "ManyColumns").GetAwaiter().GetResult();
            return(order2EdmModel);
        }
        internal static EdmModel CreateOeEdmModel(bool useRelationalNulls)
        {
            var dataAdapter = new OrderDataAdapter(true, useRelationalNulls);
            OeEdmModelMetadataProvider metadataProvider = OrderDataAdapter.CreateMetadataProvider();
            bool allowCache        = TestHelper.GetQueryCache(dataAdapter).AllowCache;
            var  order2DataAdapter = new Order2DataAdapter(allowCache, useRelationalNulls);
            var  refModel          = new OeEdmModelBuilder(dataAdapter, metadataProvider).BuildEdmModel();

            return(order2DataAdapter.BuildEdmModel(refModel));
        }
        public void FluentApi()
        {
            var      ethalonDataAdapter = new OrderDataAdapter(false, false, null);
            EdmModel ethalonEdmModel    = ethalonDataAdapter.BuildEdmModel();
            String   ethalonSchema      = TestHelper.GetCsdlSchema(ethalonEdmModel);

            if (ethalonSchema == null)
            {
                throw new InvalidOperationException("Invalid ethalon schema");
            }

            var      testDataAdapter = new OrderDataAdapter(false, false, null);
            EdmModel testEdmModel    = testDataAdapter.BuildEdmModelFromEfCoreModel();
            String   testSchema      = TestHelper.GetCsdlSchema(testEdmModel);

            if (testSchema == null)
            {
                throw new InvalidOperationException("Invalid test schema");
            }

            Assert.Equal(ethalonSchema, testSchema);
        }
        public void FluentApi()
        {
            var      ethalonDataAdapter = new OeEfCoreDataAdapter <OrderContext>(OrderContextOptions.Create(true));
            EdmModel ethalonEdmModel    = ethalonDataAdapter.BuildEdmModel();
            String   ethalonSchema      = TestHelper.GetCsdlSchema(ethalonEdmModel);

            if (ethalonSchema == null)
            {
                throw new InvalidOperationException("Invalid ethalon schema");
            }

            var      testDataAdapter = new OrderDataAdapter(false, false);
            EdmModel testEdmModel    = testDataAdapter.BuildEdmModelFromEf6Model();
            String   testSchema      = TestHelper.GetCsdlSchema(testEdmModel);

            if (testSchema == null)
            {
                throw new InvalidOperationException("Invalid test schema");
            }

            String fixTestSchema = FixNamesInSchema(testSchema);

            Assert.Equal(ethalonSchema, fixTestSchema);
        }
Esempio n. 5
0
 private DbFixture(bool useRelationalNulls, String databaseName, Db.OeDataAdapter dataAdapter)
     : this(useRelationalNulls, databaseName, dataAdapter, OrderDataAdapter.CreateMetadataProvider(useRelationalNulls, databaseName))
 {
 }