本文整理汇总了C#中System.Data.Services.Providers.ResourceProperty.GetAnnotation方法的典型用法代码示例。如果您正苦于以下问题:C# ResourceProperty.GetAnnotation方法的具体用法?C# ResourceProperty.GetAnnotation怎么用?C# ResourceProperty.GetAnnotation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.Services.Providers.ResourceProperty
的用法示例。
在下文中一共展示了ResourceProperty.GetAnnotation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetResourceAssociationSet
/// <summary>
/// Gets the ResourceAssociationSet instance when given the source association end.
/// </summary>
/// <param name="resourceSet">Resource set of the source association end.</param>
/// <param name="resourceType">Resource type of the source association end.</param>
/// <param name="resourceProperty">Resource property of the source association end.</param>
/// <returns>ResourceAssociationSet instance.</returns>
/// <remarks>This method returns a ResourceAssociationSet representing a reference which is specified
/// by the <paramref name="resourceProperty"/> on the <paramref name="resourceType"/> for instances in the <paramref name="resourceSet"/>.</remarks>
public ResourceAssociationSet GetResourceAssociationSet(ResourceSet resourceSet, ResourceType resourceType, ResourceProperty resourceProperty)
{
// We have the resource association set precreated on the property annotation, so no need to compute anything in here
ResourceAssociationSet resourceAssociationSet = resourceProperty.GetAnnotation().ResourceAssociationSet;
// Just few verification to show what is expected of the returned resource association set.
Debug.Assert(resourceAssociationSet.End1.ResourceSet == resourceSet, "The precreated resource association set doesn't match the specified resource set.");
Debug.Assert(resourceAssociationSet.End1.ResourceType == resourceType, "The precreated resource association set doesn't match the specified resource type.");
Debug.Assert(resourceAssociationSet.End1.ResourceProperty == resourceProperty, "The precreated resource association set doesn't match its resource property.");
return resourceAssociationSet;
}