Ejemplo n.º 1
0
        public void Add(string potName, Snapshot snapshot)
        {
            PotDirectory potDirectory = PotDirectory.FromPotName(potName);

            if (!potDirectory.IsValid)
            {
                throw new Exception($"There is no pot with name '{potName}'.");
            }

            SnapshotFile snapshotFile = potDirectory.CreateSnapshotFile(snapshot.CreationTime);

            snapshotFile.Open();
            snapshotFile.Snapshot = snapshot.ToJSnapshot();
            snapshotFile.Save();
        }