コード例 #1
0
        private async Task WriteEntry(Db.IOeDbEnumerator dbEnumerator, Object value)
        {
            OeEntryFactory entryFactory = dbEnumerator.EntryFactory;
            ODataResource  entry        = CreateEntry(entryFactory, value);
            await _writer.WriteStartAsync(entry).ConfigureAwait(false);

            for (int i = 0; i < entryFactory.NavigationLinks.Count; i++)
            {
                if (entryFactory.NavigationLinks[i].NextLink)
                {
                    await WriteNavigationNextLink(entryFactory, entryFactory.NavigationLinks[i].NavigationSelectItem, value).ConfigureAwait(false);
                }
                else
                {
                    await WriteNavigation(dbEnumerator.CreateChild(entryFactory.NavigationLinks[i], _cancellationToken)).ConfigureAwait(false);
                }
            }
            await _writer.WriteEndAsync().ConfigureAwait(false);
        }
コード例 #2
0
            private async Task WriteEntry(Db.IOeDbEnumerator dbEnumerator, Object value, bool navigationNextLink)
            {
                OeEntryFactory entryFactory = dbEnumerator.EntryFactory;
                ODataResource  entry        = CreateEntry(entryFactory, value);

                _writer.WriteStart(entry);
                for (int i = 0; i < entryFactory.NavigationLinks.Count; i++)
                {
                    await WriteNavigationLink(dbEnumerator.CreateChild(entryFactory.NavigationLinks[i])).ConfigureAwait(false);
                }

                if (navigationNextLink)
                {
                    foreach (ExpandedNavigationSelectItem item in GetExpandedNavigationSelectItems(_queryContext.ODataUri.SelectAndExpand))
                    {
                        WriteNavigationNextLink(entryFactory, item, value);
                    }
                }

                _writer.WriteEnd();
            }