/// <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)
        {
            string literal = attribute.Context.Domain.Dialect.Literal(attribute.Data?.Source.Snapshot);

            if (literal == null)
            {
                return(attribute.Par());
            }
            else
            {
                return(attribute.Append(literal));
            }
        }
예제 #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));
            }
        }