❔ [System.Text.Json] When to close the stream
I have a very large json file (500 mb or more), so naturally i would use
Now i want to open a stream to a file using the following:
But what if the serializer needs the stream afterwards? If i leave it open, the stream would be dangling in limbo until the GC decides that it really wouldnt neeed that referencing memory anymore....
System.Text.Json in combination with IAsyncEnumerable<FileMetaDataDto>.Now i want to open a stream to a file using the following:
But what if the serializer needs the stream afterwards? If i leave it open, the stream would be dangling in limbo until the GC decides that it really wouldnt neeed that referencing memory anymore....