private void CreateForeignKeys() { LogMessage("Generating create foreign keys"); var fks = new List <ForeignKeyInfo>(); if (_options.TableOptions.CreateForeignKeys) { fks.AddRange(_tables.SelectMany(x => x.ForeignKeys)); } if (_options.TableOptions.CreateReferences) { fks.AddRange(_tables.SelectMany(x => x.GetReferences())); } fks.Distinct().ToList().ForEach(x => _dmp.CreateForeignKey(x)); }