/// <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(); } } }
public StreamEnumerator(Stream stream, IContentTypeProvider contentTypeProvider) { var enumerable = contentTypeProvider.DeserializeCollection <T>(stream); Enumerator = enumerable.GetEnumerator(); }