Beispiel #1
0
 /// <summary>
 /// Deserializes the body to an IEnumerable of entities of the given type
 /// </summary>
 public IAsyncEnumerable <T> Deserialize <T>()
 {
     if (IsClosed)
     {
         throw new ObjectDisposedException(nameof(Stream));
     }
     try
     {
         return(ContentTypeProvider.DeserializeCollection <T>(Stream));
     }
     finally
     {
         if (CanSeek)
         {
             Stream.Rewind();
         }
     }
 }
Beispiel #2
0
        public StreamEnumerator(Stream stream, IContentTypeProvider contentTypeProvider)
        {
            var enumerable = contentTypeProvider.DeserializeCollection <T>(stream);

            Enumerator = enumerable.GetEnumerator();
        }