本文整理汇总了C#中IEdmModel.GetAlternateKeysAnnotation方法的典型用法代码示例。如果您正苦于以下问题:C# IEdmModel.GetAlternateKeysAnnotation方法的具体用法?C# IEdmModel.GetAlternateKeysAnnotation怎么用?C# IEdmModel.GetAlternateKeysAnnotation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEdmModel
的用法示例。
在下文中一共展示了IEdmModel.GetAlternateKeysAnnotation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TryBindToDeclaredAlternateKey
/// <summary>
/// Tries to bind key values to a key lookup on a collection.
/// </summary>
/// <param name="collectionNode">Already bound collection node.</param>
/// <param name="namedValues">The named value tokens to bind.</param>
/// <param name="model">The model to be used.</param>
/// <param name="collectionItemEntityType">The type of a single item in a collection to apply the key value to.</param>
/// <param name="keyLookupNode">The bound key lookup.</param>
/// <returns>Returns true if binding succeeded.</returns>
private bool TryBindToDeclaredAlternateKey(EntityCollectionNode collectionNode, IEnumerable<NamedValue> namedValues, IEdmModel model, IEdmEntityType collectionItemEntityType, out QueryNode keyLookupNode)
{
IEnumerable<IDictionary<string, IEdmProperty>> alternateKeys = model.GetAlternateKeysAnnotation(collectionItemEntityType);
foreach (IDictionary<string, IEdmProperty> keys in alternateKeys)
{
if (TryBindToKeys(collectionNode, namedValues, model, collectionItemEntityType, keys, out keyLookupNode))
{
return true;
}
}
keyLookupNode = null;
return false;
}