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


C# IEdmNavigationProperty.PopulateCaches方法代码示例

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


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

示例1: GetAssociationAnnotations

		public static void GetAssociationAnnotations(this IEdmModel model, IEdmNavigationProperty property, out IEnumerable<IEdmDirectValueAnnotation> annotations, out IEnumerable<IEdmDirectValueAnnotation> end1Annotations, out IEnumerable<IEdmDirectValueAnnotation> end2Annotations, out IEnumerable<IEdmDirectValueAnnotation> constraintAnnotations)
		{
			annotations = null;
			end1Annotations = null;
			end2Annotations = null;
			constraintAnnotations = null;
			EdmUtil.CheckArgumentNull<IEdmModel>(model, "model");
			EdmUtil.CheckArgumentNull<IEdmNavigationProperty>(property, "property");
			property.PopulateCaches();
			SerializationExtensionMethods.AssociationAnnotations annotationValue = model.GetAnnotationValue<SerializationExtensionMethods.AssociationAnnotations>(property, "http://schemas.microsoft.com/ado/2011/04/edm/internal", "AssociationAnnotations");
			if (annotationValue == null)
			{
				IEnumerable<IEdmDirectValueAnnotation> edmDirectValueAnnotations = Enumerable.Empty<IEdmDirectValueAnnotation>();
				annotations = edmDirectValueAnnotations;
				end1Annotations = edmDirectValueAnnotations;
				end2Annotations = edmDirectValueAnnotations;
				constraintAnnotations = edmDirectValueAnnotations;
				return;
			}
			else
			{
				IEnumerable<IEdmDirectValueAnnotation> enumerablePointers = annotations;
				IEnumerable<IEdmDirectValueAnnotation> edmDirectValueAnnotations1 = annotationValue.Annotations;
				IEnumerable<IEdmDirectValueAnnotation> edmDirectValueAnnotations2 = edmDirectValueAnnotations1;
				if (edmDirectValueAnnotations1 == null)
				{
					edmDirectValueAnnotations2 = Enumerable.Empty<IEdmDirectValueAnnotation>();
				}
				(enumerablePointers) = edmDirectValueAnnotations2;
				IEnumerable<IEdmDirectValueAnnotation> enumerablePointers1 = end1Annotations;
				IEnumerable<IEdmDirectValueAnnotation> edmDirectValueAnnotations3 = annotationValue.End1Annotations;
				IEnumerable<IEdmDirectValueAnnotation> edmDirectValueAnnotations4 = edmDirectValueAnnotations3;
				if (edmDirectValueAnnotations3 == null)
				{
					edmDirectValueAnnotations4 = Enumerable.Empty<IEdmDirectValueAnnotation>();
				}
				(enumerablePointers1) = edmDirectValueAnnotations4;
				IEnumerable<IEdmDirectValueAnnotation> enumerablePointers2 = end2Annotations;
				IEnumerable<IEdmDirectValueAnnotation> edmDirectValueAnnotations5 = annotationValue.End2Annotations;
				IEnumerable<IEdmDirectValueAnnotation> edmDirectValueAnnotations6 = edmDirectValueAnnotations5;
				if (edmDirectValueAnnotations5 == null)
				{
					edmDirectValueAnnotations6 = Enumerable.Empty<IEdmDirectValueAnnotation>();
				}
				(enumerablePointers2) = edmDirectValueAnnotations6;
				IEnumerable<IEdmDirectValueAnnotation> enumerablePointers3 = constraintAnnotations;
				IEnumerable<IEdmDirectValueAnnotation> edmDirectValueAnnotations7 = annotationValue.ConstraintAnnotations;
				IEnumerable<IEdmDirectValueAnnotation> edmDirectValueAnnotations8 = edmDirectValueAnnotations7;
				if (edmDirectValueAnnotations7 == null)
				{
					edmDirectValueAnnotations8 = Enumerable.Empty<IEdmDirectValueAnnotation>();
				}
				(enumerablePointers3) = edmDirectValueAnnotations8;
				return;
			}
		}
开发者ID:nickchal,项目名称:pash,代码行数:56,代码来源:SerializationExtensionMethods.cs

示例2: GetAssociationFullName

		public static string GetAssociationFullName(this IEdmModel model, IEdmNavigationProperty property)
		{
			EdmUtil.CheckArgumentNull<IEdmModel>(model, "model");
			EdmUtil.CheckArgumentNull<IEdmNavigationProperty>(property, "property");
			property.PopulateCaches();
			return string.Concat(model.GetAssociationNamespace(property), ".", model.GetAssociationName(property));
		}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:SerializationExtensionMethods.cs

示例3: GetAssociationEndName

		public static string GetAssociationEndName(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", "AssociationEndName");
			string name = annotationValue;
			if (annotationValue == null)
			{
				name = property.Partner.Name;
			}
			return name;
		}
开发者ID:nickchal,项目名称:pash,代码行数:13,代码来源:SerializationExtensionMethods.cs

示例4: 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

示例5: 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

示例6: GetAssociationEndName

 /// <summary>
 /// Gets the name used for the association end 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 end name.</returns>
 public static string GetAssociationEndName(this IEdmModel model, IEdmNavigationProperty property)
 {
     EdmUtil.CheckArgumentNull(model, "model");
     EdmUtil.CheckArgumentNull(property, "property");
     
     property.PopulateCaches();
     return model.GetAnnotationValue<string>(property, EdmConstants.InternalUri, CsdlConstants.AssociationEndNameAnnotation) ?? property.Partner.Name;
 }
开发者ID:smasonuk,项目名称:odata-sparql,代码行数:14,代码来源:SerializationExtensionMethods.cs

示例7: GetAssociationAnnotations

 /// <summary>
 /// Gets the annotations associated with the association serialized for a navigation property.
 /// </summary>
 /// <param name="model">Model containing the navigation property.</param>
 /// <param name="property">The navigation property.</param>
 /// <param name="annotations">The association annotations.</param>
 /// <param name="end1Annotations">The annotations for association end 1.</param>
 /// <param name="end2Annotations">The annotations for association end 2.</param>
 /// <param name="constraintAnnotations">The annotations for the referential constraint.</param>
 public static void GetAssociationAnnotations(this IEdmModel model, IEdmNavigationProperty property, out IEnumerable<IEdmDirectValueAnnotation> annotations, out IEnumerable<IEdmDirectValueAnnotation> end1Annotations, out IEnumerable<IEdmDirectValueAnnotation> end2Annotations, out IEnumerable<IEdmDirectValueAnnotation> constraintAnnotations)
 {
     EdmUtil.CheckArgumentNull(model, "model");
     EdmUtil.CheckArgumentNull(property, "property");
     
     property.PopulateCaches();
     AssociationAnnotations associationAnnotations = model.GetAnnotationValue<AssociationAnnotations>(property, EdmConstants.InternalUri, CsdlConstants.AssociationAnnotationsAnnotation);
     if (associationAnnotations != null)
     {
         annotations = associationAnnotations.Annotations ?? Enumerable.Empty<IEdmDirectValueAnnotation>();
         end1Annotations = associationAnnotations.End1Annotations ?? Enumerable.Empty<IEdmDirectValueAnnotation>();
         end2Annotations = associationAnnotations.End2Annotations ?? Enumerable.Empty<IEdmDirectValueAnnotation>();
         constraintAnnotations = associationAnnotations.ConstraintAnnotations ?? Enumerable.Empty<IEdmDirectValueAnnotation>();
     }
     else
     {
         IEnumerable<IEdmDirectValueAnnotation> empty = Enumerable.Empty<IEdmDirectValueAnnotation>();
         annotations = empty;
         end1Annotations = empty;
         end2Annotations = empty;
         constraintAnnotations = empty;
     }
 }
开发者ID:smasonuk,项目名称:odata-sparql,代码行数:32,代码来源:SerializationExtensionMethods.cs

示例8: GetAssociationFullName

 /// <summary>
 /// Gets the fully-qualified 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 fully-qualified association name.</returns>
 public static string GetAssociationFullName(this IEdmModel model, IEdmNavigationProperty property)
 {
     EdmUtil.CheckArgumentNull(model, "model");
     EdmUtil.CheckArgumentNull(property, "property");
     
     property.PopulateCaches();
     return model.GetAssociationNamespace(property) + "." + model.GetAssociationName(property);
 }
开发者ID:smasonuk,项目名称:odata-sparql,代码行数:14,代码来源:SerializationExtensionMethods.cs

示例9: 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

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