Exemple #1
0
        public override ITable Evaluate(IQueryContext context)
        {
            // Is the result available in the context?
            var childTable = context.GetCachedTable(Id.ToString());
            if (childTable == null) {
                // No so evaluate the child and cache it
                childTable = Child.Evaluate(context);
                context.CacheTable(Id.ToString(), childTable);
            }

            return childTable;
        }
        public static ITable GetTable(this IQueryContext context, ObjectName tableName)
        {
            var table = context.GetCachedTable(tableName.FullName) as ITable;

            if (table == null)
            {
                table = context.Session().GetTable(tableName);
                if (table != null)
                {
                    table = new UserContextTable(context, table);
                    context.CacheTable(tableName.FullName, table);
                }
            }

            return(table);
        }