public override SqlFragment Visit(DbScanExpression expression) { EntitySetBase target = expression.Target; TableFragment fragment = new TableFragment(); MetadataProperty property; bool propExists = target.MetadataProperties.TryGetValue("DefiningQuery", true, out property); if (propExists && property.Value != null) { fragment.DefiningQuery = new LiteralFragment(property.Value as string); } else { fragment.Schema = target.EntityContainer.Name; fragment.Table = target.Name; propExists = target.MetadataProperties.TryGetValue("Schema", true, out property); if (propExists && property.Value != null) { fragment.Schema = property.Value as string; } propExists = target.MetadataProperties.TryGetValue("Table", true, out property); if (propExists && property.Value != null) { fragment.Table = property.Value as string; } } return(fragment); }
private List <ColumnFragment> GetDefaultColumnsForTable(TableFragment table) { List <ColumnFragment> columns = new List <ColumnFragment>(); foreach (EdmProperty property in Metadata.GetProperties(table.Type.EdmType)) { ColumnFragment col = new ColumnFragment(table.Name, property.Name); col.PushInput(property.Name); col.PushInput(table.Name); columns.Add(col); } return(columns); }
private List <ColumnFragment> GetDefaultColumnsForTable(TableFragment table) { //List<ColumnFragment> columns = new List<ColumnFragment>(); //foreach (EdmProperty property in Metadata.GetProperties(table.Type.EdmType)) //{ // ColumnFragment col = new ColumnFragment(table.Name, property.Name); // col.PushInput(property.Name); // col.PushInput(table.Name); // columns.Add(col); //} //return columns; throw new NotImplementedException(); }
private List<ColumnFragment> GetDefaultColumnsForTable(TableFragment table) { //List<ColumnFragment> columns = new List<ColumnFragment>(); //foreach (EdmProperty property in Metadata.GetProperties(table.Type.EdmType)) //{ // ColumnFragment col = new ColumnFragment(table.Name, property.Name); // col.PushInput(property.Name); // col.PushInput(table.Name); // columns.Add(col); //} //return columns; throw new NotImplementedException(); }
private List<ColumnFragment> GetDefaultColumnsForTable(TableFragment table) { List<ColumnFragment> columns = new List<ColumnFragment>(); foreach (EdmProperty property in Metadata.GetProperties(table.Type.EdmType)) { ColumnFragment col = new ColumnFragment(table.Name, property.Name); col.PushInput(property.Name); col.PushInput(table.Name); columns.Add(col); } return columns; }