public List <string> TypeEntriesChanged(PgType oldType) { foreach (PgType type in this.Types) { if (type.Name == oldType.Name) { var newEntries = new List <string>(); foreach (var entry in oldType.EnumEntries) { if (!type.EnumEntries.Contains(entry)) { return(null); // returns null because the old type can't contain more than the new one (means it was deleted and new created) } } foreach (var entry in type.EnumEntries) { if (!oldType.EnumEntries.Contains(entry)) { newEntries.Add(entry); } } return(newEntries); } } return(null); }
/// <summary> /// Adds the given <see cref="PgType"/> to this <see cref="PgSchema"/>. /// </summary> public void Add(PgType type) { this.Types.Add(type); }