Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Adds the given <see cref="PgType"/> to this <see cref="PgSchema"/>.
 /// </summary>
 public void Add(PgType type)
 {
     this.Types.Add(type);
 }