public static void GetAssociationSetAnnotations(this IEdmModel model, IEdmEntitySet entitySet, IEdmNavigationProperty property, out IEnumerable <IEdmDirectValueAnnotation> annotations, out IEnumerable <IEdmDirectValueAnnotation> end1Annotations, out IEnumerable <IEdmDirectValueAnnotation> end2Annotations)
        {
            annotations     = null;
            end1Annotations = null;
            end2Annotations = null;
            SerializationExtensionMethods.AssociationSetAnnotations associationSetAnnotation = null;
            EdmUtil.CheckArgumentNull <IEdmModel>(model, "model");
            EdmUtil.CheckArgumentNull <IEdmEntitySet>(entitySet, "entitySet");
            EdmUtil.CheckArgumentNull <IEdmNavigationProperty>(property, "property");
            Dictionary <string, SerializationExtensionMethods.AssociationSetAnnotations> annotationValue = model.GetAnnotationValue <Dictionary <string, SerializationExtensionMethods.AssociationSetAnnotations> >(entitySet, "http://schemas.microsoft.com/ado/2011/04/edm/internal", "AssociationSetAnnotations");

            if (annotationValue == null || !annotationValue.TryGetValue(property.Name, out associationSetAnnotation))
            {
                IEnumerable <IEdmDirectValueAnnotation> edmDirectValueAnnotations = Enumerable.Empty <IEdmDirectValueAnnotation>();
                annotations     = edmDirectValueAnnotations;
                end1Annotations = edmDirectValueAnnotations;
                end2Annotations = edmDirectValueAnnotations;
                return;
            }
            else
            {
                IEnumerable <IEdmDirectValueAnnotation> enumerablePointers         = annotations;
                IEnumerable <IEdmDirectValueAnnotation> edmDirectValueAnnotations1 = associationSetAnnotation.Annotations;
                IEnumerable <IEdmDirectValueAnnotation> edmDirectValueAnnotations2 = edmDirectValueAnnotations1;
                if (edmDirectValueAnnotations1 == null)
                {
                    edmDirectValueAnnotations2 = Enumerable.Empty <IEdmDirectValueAnnotation>();
                }
                (enumerablePointers) = edmDirectValueAnnotations2;
                IEnumerable <IEdmDirectValueAnnotation> enumerablePointers1        = end1Annotations;
                IEnumerable <IEdmDirectValueAnnotation> edmDirectValueAnnotations3 = associationSetAnnotation.End1Annotations;
                IEnumerable <IEdmDirectValueAnnotation> edmDirectValueAnnotations4 = edmDirectValueAnnotations3;
                if (edmDirectValueAnnotations3 == null)
                {
                    edmDirectValueAnnotations4 = Enumerable.Empty <IEdmDirectValueAnnotation>();
                }
                (enumerablePointers1) = edmDirectValueAnnotations4;
                IEnumerable <IEdmDirectValueAnnotation> enumerablePointers2        = end2Annotations;
                IEnumerable <IEdmDirectValueAnnotation> edmDirectValueAnnotations5 = associationSetAnnotation.End2Annotations;
                IEnumerable <IEdmDirectValueAnnotation> edmDirectValueAnnotations6 = edmDirectValueAnnotations5;
                if (edmDirectValueAnnotations5 == null)
                {
                    edmDirectValueAnnotations6 = Enumerable.Empty <IEdmDirectValueAnnotation>();
                }
                (enumerablePointers2) = edmDirectValueAnnotations6;
                return;
            }
        }
 public static void SetAssociationSetAnnotations(this IEdmModel model, IEdmEntitySet entitySet, IEdmNavigationProperty property, IEnumerable <IEdmDirectValueAnnotation> annotations, IEnumerable <IEdmDirectValueAnnotation> end1Annotations, IEnumerable <IEdmDirectValueAnnotation> end2Annotations)
 {
     EdmUtil.CheckArgumentNull <IEdmModel>(model, "model");
     EdmUtil.CheckArgumentNull <IEdmEntitySet>(entitySet, "property");
     EdmUtil.CheckArgumentNull <IEdmNavigationProperty>(property, "property");
     if (annotations != null && annotations.FirstOrDefault <IEdmDirectValueAnnotation>() != null || end1Annotations != null && end1Annotations.FirstOrDefault <IEdmDirectValueAnnotation>() != null || end2Annotations != null && end2Annotations.FirstOrDefault <IEdmDirectValueAnnotation>() != null)
     {
         Dictionary <string, SerializationExtensionMethods.AssociationSetAnnotations> annotationValue = model.GetAnnotationValue <Dictionary <string, SerializationExtensionMethods.AssociationSetAnnotations> >(entitySet, "http://schemas.microsoft.com/ado/2011/04/edm/internal", "AssociationSetAnnotations");
         if (annotationValue == null)
         {
             annotationValue = new Dictionary <string, SerializationExtensionMethods.AssociationSetAnnotations>();
             model.SetAnnotationValue(entitySet, "http://schemas.microsoft.com/ado/2011/04/edm/internal", "AssociationSetAnnotations", annotationValue);
         }
         SerializationExtensionMethods.AssociationSetAnnotations associationSetAnnotation = new SerializationExtensionMethods.AssociationSetAnnotations();
         associationSetAnnotation.Annotations     = annotations;
         associationSetAnnotation.End1Annotations = end1Annotations;
         associationSetAnnotation.End2Annotations = end2Annotations;
         annotationValue[property.Name]           = associationSetAnnotation;
     }
 }
		public static void SetAssociationSetAnnotations(this IEdmModel model, IEdmEntitySet entitySet, IEdmNavigationProperty property, IEnumerable<IEdmDirectValueAnnotation> annotations, IEnumerable<IEdmDirectValueAnnotation> end1Annotations, IEnumerable<IEdmDirectValueAnnotation> end2Annotations)
		{
			EdmUtil.CheckArgumentNull<IEdmModel>(model, "model");
			EdmUtil.CheckArgumentNull<IEdmEntitySet>(entitySet, "property");
			EdmUtil.CheckArgumentNull<IEdmNavigationProperty>(property, "property");
			if (annotations != null && annotations.FirstOrDefault<IEdmDirectValueAnnotation>() != null || end1Annotations != null && end1Annotations.FirstOrDefault<IEdmDirectValueAnnotation>() != null || end2Annotations != null && end2Annotations.FirstOrDefault<IEdmDirectValueAnnotation>() != null)
			{
				Dictionary<string, SerializationExtensionMethods.AssociationSetAnnotations> annotationValue = model.GetAnnotationValue<Dictionary<string, SerializationExtensionMethods.AssociationSetAnnotations>>(entitySet, "http://schemas.microsoft.com/ado/2011/04/edm/internal", "AssociationSetAnnotations");
				if (annotationValue == null)
				{
					annotationValue = new Dictionary<string, SerializationExtensionMethods.AssociationSetAnnotations>();
					model.SetAnnotationValue(entitySet, "http://schemas.microsoft.com/ado/2011/04/edm/internal", "AssociationSetAnnotations", annotationValue);
				}
				SerializationExtensionMethods.AssociationSetAnnotations associationSetAnnotation = new SerializationExtensionMethods.AssociationSetAnnotations();
				associationSetAnnotation.Annotations = annotations;
				associationSetAnnotation.End1Annotations = end1Annotations;
				associationSetAnnotation.End2Annotations = end2Annotations;
				annotationValue[property.Name] = associationSetAnnotation;
			}
		}