当前位置: 首页>>代码示例>>C#>>正文


C# EdmModel.GetEntityType方法代码示例

本文整理汇总了C#中System.Data.Entity.Core.Metadata.Edm.EdmModel.GetEntityType方法的典型用法代码示例。如果您正苦于以下问题:C# EdmModel.GetEntityType方法的具体用法?C# EdmModel.GetEntityType怎么用?C# EdmModel.GetEntityType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Data.Entity.Core.Metadata.Edm.EdmModel的用法示例。


在下文中一共展示了EdmModel.GetEntityType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetEntityType_should_return_correct_type

        public void GetEntityType_should_return_correct_type()
        {
            var model = new EdmModel(DataSpace.CSpace);
            var entityType = model.AddEntityType("Foo");

            var foundEntityType = model.GetEntityType("Foo");

            Assert.NotNull(foundEntityType);
            Assert.Same(entityType, foundEntityType);
        }
开发者ID:christiandpena,项目名称:entityframework,代码行数:10,代码来源:EdmModelExtensionsTests.cs

示例2: ConfigureEntities

        private void ConfigureEntities(EdmModel model)
        {
            DebugCheck.NotNull(model);

            foreach (var entityTypeConfiguration in ActiveEntityConfigurations)
            {
                var structuralType = entityTypeConfiguration.ClrType;
                var entityType = model.GetEntityType(structuralType);

                Debug.Assert(entityType != null);

                entityTypeConfiguration.Configure(entityType, model);
            }
        }
开发者ID:jwanagel,项目名称:jjwtest,代码行数:14,代码来源:ModelConfiguration.cs

示例3: MapEntityType_should_create_entity_type_with_clr_type_name_and_add_to_model

        public void MapEntityType_should_create_entity_type_with_clr_type_name_and_add_to_model()
        {
            var model = new EdmModel(DataSpace.CSpace);
            var typeMapper = new TypeMapper(new MappingContext(new ModelConfiguration(), new ConventionsConfiguration(), model));
            var mockType = new MockType("Foo");

            var entityType = typeMapper.MapEntityType(mockType);

            Assert.NotNull(entityType);
            Assert.Same(entityType, model.GetEntityType("Foo"));
        }
开发者ID:christiandpena,项目名称:entityframework,代码行数:11,代码来源:TypeMapperTests.cs

示例4: ConfigureEntities

        private void ConfigureEntities(EdmModel model)
        {
            DebugCheck.NotNull(model);

            foreach (var entityTypeConfiguration in ActiveEntityConfigurations)
            {
                ConfigureFunctionMappings(model, entityTypeConfiguration, model.GetEntityType(entityTypeConfiguration.ClrType));
            }

            foreach (var entityTypeConfiguration in ActiveEntityConfigurations)
            {
                entityTypeConfiguration.Configure(model.GetEntityType(entityTypeConfiguration.ClrType), model);
            }
        }
开发者ID:jesusico83,项目名称:Telerik,代码行数:14,代码来源:ModelConfiguration.cs


注:本文中的System.Data.Entity.Core.Metadata.Edm.EdmModel.GetEntityType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。