private static void MergeReferences(TableDefinition main, TableDefinition changes, TableDefinition tableDefinition) { foreach (var reference in main.References.Concat(changes.References)) { tableDefinition.SetReference(reference.OurField, reference.TargetTable, reference.TargetField); } }
/// <summary> /// Define that a field on this table contains a value that identifies a row on another table. /// </summary> /// <param name="fieldName">The field on this table doing the referencing</param> /// <param name="tableReferenced">The table being referenced</param> /// <param name="fieldReferenced">The field on the referenced table that contains the value that matches the reference</param> public TableDefiner IsReference(string fieldName, string tableReferenced, string fieldReferenced) { _tableDefinition.SetReference(fieldName, tableReferenced, fieldReferenced); return(this); }