Esempio n. 1
0
        public void TestNoValidEntitySet()
        {
            var type = model.GetEntityTypes().Where(t => t.Name == "testEntity").First();
            var prop = type.Properties.Where(p => p.Name == "testInvalidNav").First();;

            OdcmProperty result = OdcmModelExtensions.GetServiceCollectionNavigationPropertyForPropertyType(prop, model);

            Assert.IsNull(result);
        }
Esempio n. 2
0
        public void TestImplicitEntitySet()
        {
            var type = model.GetEntityTypes().Where(t => t.Name == "testEntity").First();
            var prop = type.Properties.Where(p => p.Name == "testNav").First();

            OdcmProperty result    = OdcmModelExtensions.GetServiceCollectionNavigationPropertyForPropertyType(prop, model);
            var          singleton = model.GetEntityTypes().Where(t => t.Name == "testSingleton").First();

            Assert.AreEqual(singleton.Name, result.Name);
        }
Esempio n. 3
0
        public void TestExplicitEntitySet()
        {
            var type = model.GetEntityTypes().Where(t => t.Name == "testEntity").First();
            var prop = type.Properties.Where(p => p.Name == "testExplicitNav").First();

            OdcmProperty result = OdcmModelExtensions.GetServiceCollectionNavigationPropertyForPropertyType(prop, model);

            var entitySet = model.EntityContainer.Properties.Where(t => t.Name == "testTypes").First();

            Assert.AreEqual(entitySet.Name, result.Name);
        }