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


C# IEdmTypeReference.AsStructuredOrNull方法代码示例

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


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

示例1: BindProperty

        /// <summary>
        /// Given a property name, if the associated type reference is strucutred, then this returns  
        /// the property of the structured type. Otherwise, it returns null.
        /// </summary>
        /// <param name="parentReference">The parent type to be used to find binding options.</param>
        /// <param name="propertyName">The string designated the property name to be bound.</param>
        /// <param name="resolver">Resolver for uri parser.</param>
        /// <returns>The property associated with string and parent type.</returns>
        internal static IEdmProperty BindProperty(IEdmTypeReference parentReference, string propertyName, ODataUriResolver resolver = null)
        {
            if (resolver == null)
            {
                resolver = ODataUriResolver.Default;
            }

            IEdmStructuredTypeReference structuredParentType =
                parentReference == null ? null : parentReference.AsStructuredOrNull();
            return structuredParentType == null ? null : resolver.ResolveProperty(structuredParentType.StructuredDefinition(), propertyName);
        }
开发者ID:larsenjo,项目名称:odata.net,代码行数:19,代码来源:InnerPathTokenBinder.cs

示例2: BindProperty

 /// <summary>
 /// Binds a string to its associated type.
 /// </summary>
 /// <param name="parentReference">The parent type to be used to find binding options.</param>
 /// <param name="propertyName">The string designated the property name to be bound.</param>
 /// <returns>The property associated with string and parent type.</returns>
 private static IEdmProperty BindProperty(IEdmTypeReference parentReference, string propertyName)
 {
     IEdmStructuredTypeReference structuredParentType =
         parentReference == null ? null : parentReference.AsStructuredOrNull();
     return structuredParentType == null ? null : structuredParentType.FindProperty(propertyName);
 }
开发者ID:smasonuk,项目名称:odata-sparql,代码行数:12,代码来源:MetadataBinder.cs

示例3: SetEpmValue

        /// <summary>
        /// Sets the value read from EPM to a property on an entry.
        /// </summary>
        /// <param name="targetList">The target list, which is a list of properties (on entry or complex value).</param>
        /// <param name="targetTypeReference">The type of the value on which to set the property (can be entity or complex).</param>
        /// <param name="epmInfo">The EPM info for the mapping for which the value was read.</param>
        /// <param name="propertyValue">The property value read, if the value was specified as null then this should be null,
        /// if the value was missing the method should not be called at all.
        /// For primitive properties this should be the string value, for all other properties this should be the exact value type.</param>
        protected void SetEpmValue(
            IList targetList,
            IEdmTypeReference targetTypeReference,
            EntityPropertyMappingInfo epmInfo,
            object propertyValue)
        {
            Debug.Assert(epmInfo != null, "epmInfo != null");
            Debug.Assert(targetTypeReference != null, "targetTypeReference != null");
            Debug.Assert(targetList != null, "targetList != null");
            Debug.Assert(
                targetTypeReference.IsODataEntityTypeKind() || targetTypeReference.IsODataComplexTypeKind(),
                "Only entity and complex types can have an EPM value set on them.");

            this.SetEpmValueForSegment(
                epmInfo,
                0,
                targetTypeReference.AsStructuredOrNull(),
                (List<ODataProperty>)targetList,
                propertyValue);
        }
开发者ID:smasonuk,项目名称:odata-sparql,代码行数:29,代码来源:EpmReader.cs

示例4: SetEpmValue

 protected void SetEpmValue(IList targetList, IEdmTypeReference targetTypeReference, EntityPropertyMappingInfo epmInfo, object propertyValue)
 {
     this.SetEpmValueForSegment(epmInfo, 0, targetTypeReference.AsStructuredOrNull(), (List<ODataProperty>) targetList, propertyValue);
 }
开发者ID:nickchal,项目名称:pash,代码行数:4,代码来源:EpmReader.cs


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