internal IEnumerable<IEdmVocabularyAnnotation> WrapInlineVocabularyAnnotations(CsdlSemanticsElement element, CsdlSemanticsSchema schema)
        {
            IEdmVocabularyAnnotatable vocabularyAnnotatableElement = element as IEdmVocabularyAnnotatable;
            if (vocabularyAnnotatableElement != null)
            {
                IEnumerable<CsdlAnnotation> vocabularyAnnotations = element.Element.VocabularyAnnotations;
                if (vocabularyAnnotations.FirstOrDefault() != null)
                {
                    List<IEdmVocabularyAnnotation> wrappedAnnotations = new List<IEdmVocabularyAnnotation>();
                    foreach (CsdlAnnotation vocabularyAnnotation in vocabularyAnnotations)
                    {
                        IEdmVocabularyAnnotation vocabAnnotation = this.WrapVocabularyAnnotation(vocabularyAnnotation, schema, vocabularyAnnotatableElement, null, vocabularyAnnotation.Qualifier);
                        vocabAnnotation.SetSerializationLocation(this, EdmVocabularyAnnotationSerializationLocation.Inline);
                        wrappedAnnotations.Add(vocabAnnotation);
                    }

                    return wrappedAnnotations;
                }
            }

            return Enumerable.Empty<IEdmVocabularyAnnotation>();
        }
Example #2
0
		internal IEnumerable<IEdmVocabularyAnnotation> WrapInlineVocabularyAnnotations(CsdlSemanticsElement element, CsdlSemanticsSchema schema)
		{
			IEdmVocabularyAnnotatable targetContext = element as IEdmVocabularyAnnotatable;
			if (targetContext != null)
			{
				IEnumerable<CsdlVocabularyAnnotationBase> vocabularyAnnotations = element.Element.VocabularyAnnotations;
				if (vocabularyAnnotations.FirstOrDefault<CsdlVocabularyAnnotationBase>() != null)
				{
					List<IEdmVocabularyAnnotation> list = new List<IEdmVocabularyAnnotation>();
					foreach (CsdlVocabularyAnnotationBase base2 in vocabularyAnnotations)
					{
						IEdmVocabularyAnnotation annotation = this.WrapVocabularyAnnotation(base2, schema, targetContext, null, base2.Qualifier);
						annotation.SetSerializationLocation(this, 0);
						list.Add(annotation);
					}
					return list;
				}
			}
			return Enumerable.Empty<IEdmVocabularyAnnotation>();
		}