Loading 100,000 rows into a List<T> before sending it to the client will spike your RAM. Use IAsyncEnumerable to stream data.
public async IAsyncEnumerableGetUsersStream() { foreach (var user in _db.Users) { yield return await Process(user); } }
The Result: The client starts receiving data immediately, and your server’s memory usage stays flat regardless of the dataset size.
