Ejemplo n.º 1
0
            /// <summary>
            /// Visits a feed item.
            /// </summary>
            /// <param name="feed">The feed to visit.</param>
            protected override ODataPayloadElement VisitFeed(ODataFeed feed)
            {
                ExceptionUtilities.CheckArgumentNotNull(feed, "feed");

                EntitySetInstance entitySet = new EntitySetInstance()
                {
                    InlineCount = feed.Count,
                    NextLink    = feed.NextPageLink == null ? null : feed.NextPageLink.OriginalString
                };

                if (feed.Id != null)
                {
                    entitySet.AtomId(UriUtils.UriToString(feed.Id));
                }

                // now check for the entries annotation on the feed
                IEnumerable <ODataEntry> entries = feed.Entries();

                if (entries != null)
                {
                    foreach (ODataEntry entry in entries)
                    {
                        entitySet.Add(this.Visit(entry));
                    }
                }

                return(entitySet);
            }
Ejemplo n.º 2
0
        /// <summary>
        /// Visits a feed item.
        /// </summary>
        /// <param name="feed">The feed to visit.</param>
        protected virtual void VisitFeed(ODataFeed feed)
        {
            var entries = feed.Entries();

            if (entries != null)
            {
                foreach (var entry in entries)
                {
                    this.Visit(entry);
                }
            }
        }