private new JobExecution Add(JobHeader job) { JobExecution execution = new JobExecution { Identifier = Guid.NewGuid(), Job = job, }; items.Add(execution); return execution; }
private static JobHeader AddOrUpdate(string location, Guid identifier, JobData data) { int version = 1; string name = identifier.ToHex(); JobFileEntry[] info = GetInfo(location, x => x.Identifier == identifier); JobFileEntry current = info.FirstOrDefault(); if (current != null) version = current.Version + 1; string path = Path.Combine(location, $"{name}-{version}"); JobHeader header = new JobHeader { Identifier = identifier, Version = version }; File.WriteAllText(path, JsonConvert.SerializeObject(data)); return header; }
private static JobHeader AddOrUpdate(string location, Guid identifier, JobData data) { int version = 1; string name = identifier.ToHex(); JobFileEntry[] info = GetInfo(location, x => x.Identifier == identifier); JobFileEntry current = info.FirstOrDefault(); if (current != null) { version = current.Version + 1; } string path = Path.Combine(location, $"{name}-{version}"); JobHeader header = new JobHeader { Identifier = identifier, Version = version }; File.WriteAllText(path, JsonConvert.SerializeObject(data)); return(header); }
private new JobHeader Add(JobData data) { JobHeader header = new JobHeader { Identifier = Guid.NewGuid(), Version = 1 }; items[header] = data; return header; }
public void Job(JobHeader header, JobData data) { items[header] = data; }