本文整理汇总了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();
}
示例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);
}
}
示例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;
}
示例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);
}