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


C# ODataFeed.GetAnnotation方法代码示例

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


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

示例1: VisitFeed

            /// <summary>
            /// Visits a feed item.
            /// </summary>
            /// <param name="feed">The feed to visit.</param>
            protected override ODataPayloadElement VisitFeed(ODataFeed feed)
            {
                ODataPayloadElement payloadElement = base.VisitFeed(feed);
                ODataFeedPayloadOrderObjectModelAnnotation payloadOrderFeedAnnotation = feed.GetAnnotation<ODataFeedPayloadOrderObjectModelAnnotation>();
                if (payloadOrderFeedAnnotation != null)
                {
                    PayloadOrderODataPayloadElementAnnotation payloadOrderElementAnnotation = new PayloadOrderODataPayloadElementAnnotation();
                    payloadOrderElementAnnotation.PayloadItems.AddRange(payloadOrderFeedAnnotation.PayloadItems);
                    payloadElement.Add(payloadOrderElementAnnotation);
                }

                return payloadElement;
            }
开发者ID:larsenjo,项目名称:odata.net,代码行数:17,代码来源:ObjectModelToPayloadElementPayloadWithPayloadOrderConverter.cs

示例2: CreateFeed

        /// <summary>
        /// Creates the materializer feed.
        /// </summary>
        /// <param name="feed">The feed.</param>
        /// <param name="entries">The entries.</param>
        /// <returns>The materializer feed.</returns>
        public static MaterializerFeed CreateFeed(ODataFeed feed, IEnumerable<ODataEntry> entries)
        {
            Debug.Assert(feed.GetAnnotation<IEnumerable<ODataEntry>>() == null, "Feed state has already been created.");
            if (entries == null)
            {
                entries = Enumerable.Empty<ODataEntry>();
            }
            else
            {
                feed.SetAnnotation<IEnumerable<ODataEntry>>(entries);
            }

            return new MaterializerFeed(feed, entries);
        }
开发者ID:AlineGuan,项目名称:odata.net,代码行数:20,代码来源:MaterializerFeed.cs

示例3: WriteFeed

        private void WriteFeed(ODataWriter writer, Lazy<ODataReader> lazyReader, ODataFeed feed)
        {
            this.WriteStart(writer, feed);
            var annotation = feed.GetAnnotation<ODataFeedEntriesObjectModelAnnotation>();
            if (annotation != null)
            {
                int count = annotation.Count;
                for (int i = 0; i < count; ++i)
                {
                    this.WriteEntry(writer, lazyReader, annotation[i]);
                }
            }

            this.WriteEnd(writer, ODataReaderState.FeedEnd);
            this.Read(lazyReader);
        }
开发者ID:AlineGuan,项目名称:odata.net,代码行数:16,代码来源:ObjectModelWriteReadStreamer.cs

示例4: VisitFeed

            /// <summary>
            /// Visits a feed item.
            /// </summary>
            /// <param name="feed">The feed item to visit.</param>
            /// <returns>An ODataPayloadElement representing the feed.</returns>
            protected override ODataPayloadElement VisitFeed(ODataFeed feed)
            {
                ExceptionUtilities.CheckArgumentNotNull(feed, "feed");

                EntitySetInstance entitySet = (EntitySetInstance)base.VisitFeed(feed);

                var atomMetadata = feed.GetAnnotation<AtomFeedMetadata>();
                if (atomMetadata != null)
                {
                    ConvertAtomFeedMetadata(atomMetadata, entitySet);
                }

                return entitySet;
            }
开发者ID:AlineGuan,项目名称:odata.net,代码行数:19,代码来源:AtomObjectModelToPayloadElementConverter.cs

示例5: GetFeed

 /// <summary>
 /// Gets the materializer feed.
 /// </summary>
 /// <param name="feed">The feed.</param>
 /// <returns>The materializer feed.</returns>
 public static MaterializerFeed GetFeed(ODataFeed feed)
 {
     IEnumerable<ODataEntry> entries = feed.GetAnnotation<IEnumerable<ODataEntry>>();
     return new MaterializerFeed(feed, entries);
 }
开发者ID:AlineGuan,项目名称:odata.net,代码行数:10,代码来源:MaterializerFeed.cs

示例6: WriteFeed

        private void WriteFeed(ODataWriter writer, ODataFeed feed)
        {
            writer.WriteStart(feed);
            var annotation = feed.GetAnnotation<ODataFeedEntriesObjectModelAnnotation>();
            if (annotation != null)
            {
                foreach (var entry in annotation)
                {
                    this.WriteEntry(writer, entry);
                }
            }

            writer.WriteEnd();
        }
开发者ID:larsenjo,项目名称:odata.net,代码行数:14,代码来源:ObjectModelToMessageWriter.cs

示例7: VisitFeed

 /// <summary>
 /// Visits a feed item.
 /// </summary>
 /// <param name="feed">The feed to visit.</param>
 protected override void VisitFeed(ODataFeed feed)
 {
     this.VisitAtomMetadata(feed.GetAnnotation<AtomFeedMetadata>());
     base.VisitFeed(feed);
 }
开发者ID:larsenjo,项目名称:odata.net,代码行数:9,代码来源:AtomMetadataODataObjectModelVisitor.cs


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