public async void GetAllReports(NetworkStream stream) { _reportModels = await _reportRepo.ReadAllReports(); string reply = JsonSerializer.Serialize(_reportModels); byte[] bytesWrite = Encoding.ASCII.GetBytes(reply); stream.Write(bytesWrite, 0, bytesWrite.Length); }