private async void SaveJobs() { var jobInfoList = this.JobInfos.ToList(); await Task.Run(() => { lock (_locker) { var jsonJobs = JsonConvert.SerializeObject(jobInfoList); DirFileHelper.WriteText(jobsFile, jsonJobs); } }); }
public static async void SaveOutputs(string fileName, string content) { string outputsFile = Path.Combine(outputsPath, fileName); await Task.Run(() => { lock (_locker) { DirFileHelper.ExistsFile(outputsFile); DirFileHelper.WriteText(outputsFile, content); } }); }