Пример #1
0
        /// <summary>
        /// Appends the current variable name, e.g. <c>@V0</c>, to the attribute buffer.
        /// </summary>
        /// <param name="attribute">The current attribute.</param>
        /// <returns>A new attribute containing the appended buffer.</returns>
        public static IProjectionAttribute Var(this IProjectionAttribute attribute)
        {
            IField field = ProjectionHelper.GetFieldValue(attribute);

            string variableName = attribute.Context.Lookup.Variable(attribute.Identity, field);
            string dialectName  = attribute.Context.Domain.Dialect.Variable(variableName);

            return(attribute.Append(dialectName));
        }
Пример #2
0
        /// <summary>
        /// Appends the current value in safe literal form, e.g. <c>1</c>, to the attribute buffer. Parameters are used for unsafe literals.
        /// </summary>
        /// <param name="attribute">The current attribute.</param>
        /// <returns>A new attribute containing the appended buffer.</returns>
        public static IProjectionAttribute Lit(this IProjectionAttribute attribute)
        {
            IField field = ProjectionHelper.GetFieldValue(attribute);

            string literal = attribute.Context.Domain.Dialect.Literal(field?.Value);

            if (literal == null)
            {
                return(attribute.Par());
            }
            else
            {
                return(attribute.Append(literal));
            }
        }