Пример #1
0
            private void AddVocabularyAnnotations(OdcmObject odcmObject, IEdmVocabularyAnnotatable annotatableEdmEntity)
            {
#if false
                odcmObject.Annotations = ODataVocabularyReader.GetOdcmAnnotations(_edmModel, annotatableEdmEntity).ToList();
#endif
                odcmObject.Description     = _edmModel.GetDescriptionAnnotation(annotatableEdmEntity);
                odcmObject.LongDescription = _edmModel.GetLongDescriptionAnnotation(annotatableEdmEntity);

                var annotations = _edmModel.FindVocabularyAnnotations(annotatableEdmEntity)
                                  .Where(x => x.Term.Name != "Description" && x.Term.Name != "LongDescription");

                if (annotations.Any())
                {
                    SetCapabilitiesForEntity(odcmObject, annotations);
                }
            }
Пример #2
0
            private void AddVocabularyAnnotations(OdcmObject odcmObject, IEdmVocabularyAnnotatable annotatableEdmEntity)
            {
#if false
                odcmObject.Annotations = ODataVocabularyReader.GetOdcmAnnotations(_edmModel, annotatableEdmEntity).ToList();
#endif
                odcmObject.Description     = _edmModel.GetDescriptionAnnotation(annotatableEdmEntity);
                odcmObject.LongDescription = _edmModel.GetLongDescriptionAnnotation(annotatableEdmEntity);

                // https://github.com/OData/odata.net/blob/75df8f44f2b81f984589790be4885b6ee8946ad0/src/Microsoft.OData.Edm/ExtensionMethods/ExtensionMethods.cs#L196
                var annotations = _edmModel.FindVocabularyAnnotations(annotatableEdmEntity)
                                  .Where(x => x.Term.Name != "Description" && x.Term.Name != "LongDescription");

                if (annotations.Any())
                {
                    SetCapabilitiesForEntity(odcmObject, annotations);
                }
            }