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


C# IEdmEntityType.Properties方法代码示例

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


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

示例1: WriteHeader

    private void WriteHeader(IEdmEntityType entityType)
    {
        this.headers = entityType.Properties().Where(p => p.Type.IsPrimitive()).Select(p => p.Name).ToList();
        foreach (var header in this.headers)
        {
            this.context.Writer.Write("{0},", header);
        }

        this.context.Writer.WriteLine();
    }
开发者ID:nickgoodrow,项目名称:ODataSamples,代码行数:10,代码来源:CsvWriter.cs

示例2: ReadEntityType

        private void ReadEntityType(IEdmEntityType entityType)
        {
            if (IsIgnored(entityType)) return;
            var typeUri = GetUriMapping(entityType);
            var identifierPrefix = GetIdentifierPrefix(entityType);

            _typeUriMap[entityType.FullName()] = new TypeMapping
                {
                    Uri = typeUri,
                    IdentifierPrefix = identifierPrefix
                };
            foreach (IEdmProperty property in entityType.Properties())
            {
                ReadProperty(entityType, property);
            }
        }
开发者ID:smasonuk,项目名称:odata-sparql,代码行数:16,代码来源:SparqlMap.cs

示例3: GetKeyInfos

        private static string GetKeyInfos(int keyCount, string keyName, IEdmEntityType entityType, string keyPrefix, out IEdmTypeReference keyType)
        {
            Contract.Assert(keyName != null);
            Contract.Assert(entityType != null);

            string newKeyName;
            IEdmStructuralProperty keyProperty;

            if (String.IsNullOrEmpty(keyName))
            {
                Contract.Assert(keyCount == 1);
                keyProperty = entityType.Key().First();
                newKeyName = keyPrefix;
            }
            else
            {
                bool alternateKey = false;
                keyProperty = entityType.Key().FirstOrDefault(k => k.Name == keyName);
                if (keyProperty == null)
                {
                    // If it's alternate key.
                    keyProperty =
                        entityType.Properties().OfType<IEdmStructuralProperty>().FirstOrDefault(p => p.Name == keyName);
                    alternateKey = true;
                }
                Contract.Assert(keyProperty != null);

                // if there's only one key, just use the given prefix name, for example: "key, relatedKey"  
                // otherwise, to append the key name after the given prefix name.  
                // so for multiple keys, the parameter name is "keyId1, keyId2..."  
                // for navigation property, the parameter name is "relatedKeyId1, relatedKeyId2 ..."  
                // for alternate key, to append the alternate key name after the given prefix name.  
                if (alternateKey || keyCount > 1)
                {
                    newKeyName = keyPrefix + keyName;
                }
                else
                {
                    newKeyName = keyPrefix;
                }
            }

            keyType = keyProperty.Type;
            return newKeyName;
        }
开发者ID:chinadragon0515,项目名称:WebApi,代码行数:45,代码来源:ProcedureRoutingConventionHelpers.cs

示例4: CompareEntityType

        private void CompareEntityType(IEdmEntityType expectedEntityType, IEdmEntityType actualEntityType)
        {
            this.SatisfiesEquals(expectedEntityType.FullName(), actualEntityType.FullName(), "EntityType name does not match.");
            this.SatisfiesEquals(expectedEntityType.IsAbstract, actualEntityType.IsAbstract, "IsAbstract does not match for EntityType '{0}'.", expectedEntityType.FullName());

            string expectedBaseTypeName = expectedEntityType.BaseType != null ? ((IEdmSchemaElement)expectedEntityType.BaseType).FullName() : null;
            string actualBaseTypeName = actualEntityType.BaseType != null ? ((IEdmSchemaElement)actualEntityType.BaseType).FullName() : null;

            this.SatisfiesEquals(expectedBaseTypeName, actualBaseTypeName, "BaseType does not match for EntityType '{0}'.", expectedEntityType.FullName());
            this.CompareProperties(expectedEntityType.StructuralProperties().Cast<IEdmProperty>(), actualEntityType.StructuralProperties().Cast<IEdmProperty>());
            this.CompareProperties(expectedEntityType.Key().OfType<IEdmProperty>(), actualEntityType.Key().OfType<IEdmProperty>());
            this.CompareNavigationProperty(expectedEntityType.Properties().OfType<IEdmNavigationProperty>(), actualEntityType.Properties().OfType<IEdmNavigationProperty>());

            this.CompareTermAnnotations(expectedEntityType, actualEntityType);
        }
开发者ID:AlineGuan,项目名称:odata.net,代码行数:15,代码来源:VocabularyModelComparer.cs


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