public PlanVersion(PlanVersionSnapshot snapshot) { _version = new VersionData(snapshot.Version); _simulations = snapshot.Simulations.Select(x => new Simulation(x)).ToList(); _name = snapshot.Name; _actions = snapshot.Actions; _resourceTypes = snapshot.ResourceTypes; _depot = snapshot.Depot; _readonly = new ReadonlyMixin(true); }
public PlanVersionSnapshot CreateSnapshot() { var memento = new PlanVersionSnapshot { Actions = Actions.ToList(), Depot = Depot, Name = Name, ResourceTypes = ResourceTypes.ToList(), Version = new VersionDataSnapshot(Version), Simulations = Simulations.Select(x => x.CreateSnapshot()).ToList() }; return(memento); }
private PlanVersion(PlanVersionSnapshot snapshot, UserReference user) : this(snapshot) { _version = _version.Increment(user); _readonly = new ReadonlyMixin(false); }