本文整理汇总了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;
}
}
示例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));
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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);
}
示例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;
}
示例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;
}