Exemplo n.º 1
0
        private static Condition CreateConditionUsingFragment(
            MappingFragment mappingFragment, Property tableColumn, bool?isNull, string conditionValue)
        {
            var cond = mappingFragment.FindConditionForColumn(tableColumn);

            if (cond == null)
            {
                cond = new Condition(mappingFragment, null);
                cond.ColumnName.SetRefName(tableColumn);
                mappingFragment.AddCondition(cond);

                XmlModelHelper.NormalizeAndResolve(cond);
            }

            if (cond == null)
            {
                throw new ItemCreationFailureException();
            }

            ModelHelper.SetConditionPredicate(cond, isNull, conditionValue);

            return(cond);
        }