public ICommand UpdateMoleculeName(ExpressionProfile expressionProfile, string newMoleculeName) { var command = new PKSimMacroCommand(); var oldMoleculeName = expressionProfile.MoleculeName; //we are not renaming anything if (string.Equals(newMoleculeName, oldMoleculeName)) { return(command); } var(_, individual) = expressionProfile; var mainCommand = renameMoleculeReferences(individual, oldMoleculeName, newMoleculeName); command.Add(mainCommand); command.UpdatePropertiesFrom(mainCommand); allSimulationSubjectsUsing(expressionProfile).Each(x => { _lazyLoadTask.Load(x); command.Add(renameMoleculeReferences(x, oldMoleculeName, newMoleculeName)); }); return(command); }