private void AddEntityExecute() { var record = new TableDefinition { TableName = "table_generated", ColumnDefinitions = new List<ColumnDefinition> { new ColumnDefinition { Name = "Column1", IsPrimaryKey = false, Type = "string" } } }; TableDefinitions.Add(record); }
private static TableDefinitionControl CreateTableDefinitionControl(TableDefinition tableDefinition) { var control = new TableDefinitionControl { EntityName = tableDefinition.TableName, Properties = new List<PropertyDefinition>() }; if (tableDefinition.ColumnDefinitions != null && tableDefinition.ColumnDefinitions.Any()) { foreach (var columnDefinition in tableDefinition.ColumnDefinitions) { var property = new PropertyDefinition { Name = columnDefinition.Name, Type = columnDefinition.Type, IsPrimaryKey = columnDefinition.IsPrimaryKey }; control.Properties.Add(property); } } return control; }
private IEnumerable<LinkDefinition> GetAllLinkedLinks(TableDefinition tableDefinition) { return _linkDefinitions.Where( l => l.Source.TableDefinition == tableDefinition || l.Target.TableDefinition == tableDefinition).ToList(); }