private IEnumerable<JobLogEntry> LoadEntries(JobLogBlob logBlob) { // Download the blob to a temp file var temp = Path.GetTempFileName(); try { logBlob.Blob.DownloadToFile(temp); // Each line is an entry! Read them in reverse though foreach (var line in File.ReadAllLines(temp).Reverse()) { yield return ParseEntry(line); } } finally { if (File.Exists(temp)) { File.Delete(temp); } } }
private IEnumerable <JobLogEntry> LoadEntries(JobLogBlob logBlob) { // Download the blob to a temp file var temp = Path.GetTempFileName(); try { logBlob.Blob.DownloadToFile(temp); // Each line is an entry! Read them in reverse though foreach (var line in File.ReadAllLines(temp).Reverse()) { yield return(ParseEntry(line)); } } finally { if (File.Exists(temp)) { File.Delete(temp); } } }