Exemplo n.º 1
0
        static private string TeStCalculation(DbElement ele, DbAttribute att, DbQualifier qualifier)
        {
            // get Expression uda attribute
            var userDefinedAttributeExp = DbAttribute.GetDbAttribute(":uExpTest");
            var value = string.Empty;

            try
            {
                // evaluate attribute from :uExpTest to :uResultTest
                value = ele.EvaluateAsString(DbExpression.Parse(ele.GetAsString(userDefinedAttributeExp)));
            }
            catch (System.Exception)
            {
                value = "Default value";
            }

            // Result of UDA must be returned
            return(value);
        }