Habanero.BO.CriteriaManager.Parameter.FieldFullName C# (CSharp) Méthode

FieldFullName() private méthode

Returns the full field name, including table name (where applicable), field name and surrounding separators. For instance, with the separators as "[" and "]", the output would be:
[tablename].[fieldname]
See IExpression.SqlExpressionString for more detail.
private FieldFullName ( string tableFieldNameLeftSeperator, string tableFieldNameRightSeperator ) : string
tableFieldNameLeftSeperator string
tableFieldNameRightSeperator string
Résultat string
        internal string FieldFullName(string tableFieldNameLeftSeperator,
                                     string tableFieldNameRightSeperator)
        {
            if (_tableName.Length > 0)
            {
                return tableFieldNameLeftSeperator + _tableName + tableFieldNameRightSeperator + "." +
                       tableFieldNameLeftSeperator + _fieldName + tableFieldNameRightSeperator;
            }
            return tableFieldNameLeftSeperator + _fieldName + tableFieldNameRightSeperator;
        }

Usage Example

        public void TestParameterConstructors()
        {
            Parameter param = new Parameter("prop", "field", "=", "value");
            Assert.AreEqual("prop = 'value'", param.ExpressionString());
            Assert.AreEqual("[field]", param.FieldFullName("[", "]"));

            param = new Parameter("prop", "table", "field", "=", "value", ParameterType.String);
            Assert.AreEqual("prop = 'value'", param.ExpressionString());
            Assert.AreEqual("[table].[field]", param.FieldFullName("[", "]"));
        }