Ejemplo n.º 1
0
        internal static async Task <ODataCollectionValue> ReadCollectionAsync(ODataCollectionReader reader)
        {
            ArrayList items    = new ArrayList();
            string    typeName = null;

            while (await reader.ReadAsync())
            {
                typeName = AddCollectionItem(items, reader, typeName);
            }

            return(new ODataCollectionValue {
                Items = items.Cast <object>(), TypeName = typeName
            });
        }
Ejemplo n.º 2
0
        internal static async Task <ODataCollectionValue> ReadCollectionAsync(ODataCollectionReader reader)
        {
            ArrayList items    = new ArrayList();
            string    typeName = null;

            while (await reader.ReadAsync().ConfigureAwait(false))
            {
                if (ODataCollectionReaderState.Value == reader.State)
                {
                    items.Add(reader.Item);
                }
                else if (ODataCollectionReaderState.CollectionStart == reader.State)
                {
                    typeName = reader.Item.ToString();
                }
            }

            return(new ODataCollectionValue {
                Items = items.Cast <object>(), TypeName = typeName
            });
        }