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


C# ResourceProperty.GetAnnotation方法代码示例

本文整理汇总了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;
        }
开发者ID:object,项目名称:NorthwindOData,代码行数:21,代码来源:DSPMetadata.cs


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