示例#1
0
        private void CreateTableMetadata(ProjectionMetadata metadata)
        {
            ITableMetadata table = metadata.Identity.Lookup <ITableMetadata>();

            if (table != null)
            {
                metadata.Table  = table.HasFlag(TableMetadataFlags.Table) ? table : table.Owner;
                metadata.Column = table.HasFlag(TableMetadataFlags.Column) ? table : null;
            }
        }
示例#2
0
        private static ITableMetadata GetPreferredTableMetadata(IProjectionMetadata metadata)
        {
            ITableMetadata table = metadata.Table;
            ITableMetadata item  = metadata.Item?.Table;

            if (table != null && table.HasFlag(TableMetadataFlags.Table))
            {
                return(table);
            }
            else if (table?.MemberOf != null && table.MemberOf.HasFlag(TableMetadataFlags.Table))
            {
                return(table.MemberOf);
            }
            else if (item != null && item.HasFlag(TableMetadataFlags.Table))
            {
                return(item);
            }

            return(null);
        }