/// <summary> /// Adds the tables collection to database xml. /// </summary> /// <param name="tables">The tables collection to add to database xml.</param> public void AddTable(IEnumerable <DBTable> tables) { foreach (DBTable table in tables) { DBTable sameTable = this.tables.SingleOrDefault(tab => tab.Name.Equals(table.Name, StringComparison.Ordinal)); if (sameTable == null) { this.AddTable(table); } else { sameTable.AddRow(table.Rows); } } }
/// <summary> /// Adds the tables collection to database xml. /// </summary> /// <param name="tables">The tables collection to add to database xml.</param> private void AddTables(IEnumerable <XElement> tables) { foreach (XElement table in tables) { DBTable dbTable = new DBTable(table, this); DBTable sameTable = this.tables.SingleOrDefault(tab => tab.Name.Equals(dbTable.Name, StringComparison.Ordinal)); if (sameTable == null) { this.tables.Add(dbTable); } else { sameTable.AddRow(dbTable.Rows); } } }