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


C# IEdmNavigationProperty.GetPrimary方法代码示例

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


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

示例1: GetAssociationNamespace

		public static string GetAssociationNamespace(this IEdmModel model, IEdmNavigationProperty property)
		{
			EdmUtil.CheckArgumentNull<IEdmModel>(model, "model");
			EdmUtil.CheckArgumentNull<IEdmNavigationProperty>(property, "property");
			property.PopulateCaches();
			string annotationValue = model.GetAnnotationValue<string>(property, "http://schemas.microsoft.com/ado/2011/04/edm/internal", "AssociationNamespace");
			if (annotationValue == null)
			{
				annotationValue = property.GetPrimary().DeclaringEntityType().Namespace;
			}
			return annotationValue;
		}
开发者ID:nickchal,项目名称:pash,代码行数:12,代码来源:SerializationExtensionMethods.cs

示例2: GetAssociationNamespace

        /// <summary>
        /// Gets the namespace used for the association serialized for a navigation property.
        /// </summary>
        /// <param name="model">Model containing the navigation property.</param>
        /// <param name="property">The navigation property.</param>
        /// <returns>The association namespace.</returns>
        public static string GetAssociationNamespace(this IEdmModel model, IEdmNavigationProperty property)
        {
            EdmUtil.CheckArgumentNull(model, "model");
            EdmUtil.CheckArgumentNull(property, "property");
            
            property.PopulateCaches();
            string associationNamespace = model.GetAnnotationValue<string>(property, EdmConstants.InternalUri, CsdlConstants.AssociationNamespaceAnnotation);
            if (associationNamespace == null)
            {
                associationNamespace = property.GetPrimary().DeclaringEntityType().Namespace;
            }

            return associationNamespace;
        }
开发者ID:smasonuk,项目名称:odata-sparql,代码行数:20,代码来源:SerializationExtensionMethods.cs

示例3: GetAssociationName

		public static string GetAssociationName(this IEdmModel model, IEdmNavigationProperty property)
		{
			EdmUtil.CheckArgumentNull<IEdmModel>(model, "model");
			EdmUtil.CheckArgumentNull<IEdmNavigationProperty>(property, "property");
			property.PopulateCaches();
			string annotationValue = model.GetAnnotationValue<string>(property, "http://schemas.microsoft.com/ado/2011/04/edm/internal", "AssociationName");
			if (annotationValue == null)
			{
				IEdmNavigationProperty primary = property.GetPrimary();
				IEdmNavigationProperty partner = primary.Partner;
				annotationValue = string.Concat(SerializationExtensionMethods.GetQualifiedAndEscapedPropertyName(partner), (char)95, SerializationExtensionMethods.GetQualifiedAndEscapedPropertyName(primary));
			}
			return annotationValue;
		}
开发者ID:nickchal,项目名称:pash,代码行数:14,代码来源:SerializationExtensionMethods.cs

示例4: GetAssociationName

        /// <summary>
        /// Gets the name used for the association serialized for a navigation property.
        /// </summary>
        /// <param name="model">Model containing the navigation property.</param>
        /// <param name="property">The navigation property.</param>
        /// <returns>The association name.</returns>
        public static string GetAssociationName(this IEdmModel model, IEdmNavigationProperty property)
        {
            EdmUtil.CheckArgumentNull(model, "model");
            EdmUtil.CheckArgumentNull(property, "property");

            property.PopulateCaches();
            string associationName = model.GetAnnotationValue<string>(property, EdmConstants.InternalUri, CsdlConstants.AssociationNameAnnotation);
            if (associationName == null)
            {
                IEdmNavigationProperty fromPrincipal = property.GetPrimary();
                IEdmNavigationProperty toPrincipal = fromPrincipal.Partner;

                associationName =
                    GetQualifiedAndEscapedPropertyName(toPrincipal) +
                    AssociationNameEscapeChar +
                    GetQualifiedAndEscapedPropertyName(fromPrincipal);
            }
            
            return associationName;
        }
开发者ID:smasonuk,项目名称:odata-sparql,代码行数:26,代码来源:SerializationExtensionMethods.cs


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