private void ParseDataFromFeedOrEntry(IInventoryCollection dataCollection, ODataReader reader)
        {
            while (reader.Read())
            {
                if (reader.State == ODataReaderState.EntryEnd)
                {
                    {
                        var entry = reader.Item as ODataEntry;
                        if (entry != null)
                        {
                            if (entry.MediaResource != null)
                            {
                                WriteValue(null, "OData_MediaResource", entry.Properties);
                            }

                            var item = WriteProperties(entry.Properties);
                            if (item.IsValid)
                            {
                                dataCollection.AddItem(item);
                            }
                        }
                    }
                }
            }
        }
コード例 #2
0
        public IInventoryCollection Filter(Predicate <IInventoryItem> match)
        {
            IInventoryCollection newCollection = ModelFactory.CreateInventoryCollection(QueriedPropertyNames);

            foreach (IInventoryItem inventoryItem in _inventoriesItems.Where(inventoryItem => match(inventoryItem)))
            {
                newCollection.AddItem(inventoryItem);
            }

            return(newCollection);
        }