
C# 13 and .NET 9 – Modern Cross-Platform Development Fundamentals
By :

In Chapter 10, Working with Data Using Entity Framework Core, you will use a file named Northwind.db
, but you will not work with the file directly. Instead, you will interact with the SQLite database engine, which in turn will read and write to the file. In scenarios where there is no other system that "owns" the file and does the reading and writing for you, you will use a file stream to work directly with the file.
A stream is a sequence of bytes that can be read from and written to. Although files can be processed rather like arrays, with random access provided by knowing the position of a byte within the file, it is more efficient to process a file as a stream in which the bytes can be accessed in sequential order. When a human does the processing, they tend to need random access so that they can jump around the data, make changes, and then return to the data they worked on earlier. When an automated system does the processing, it tends to...