src/Misc/EFTools/EntityDesignModel/ModelHelper.cs
/// <summary>
///     A method for setting either the Value or the IsNull attributes on a condition.
/// </summary>
A method for setting either the Value or the IsNull attributes on a condition.
A method for setting either the Value or the IsNull attributes on a condition .
internal static void SetConditionPredicate(Condition cond, bool? isNull, string conditionValue)
        {
            Debug.Assert(cond != null, "cond should not be null");
            Debug.Assert(
                (isNull != null && string.IsNullOrEmpty(conditionValue)) ||
                (isNull == null && string.IsNullOrEmpty(conditionValue) == false) ||
                (isNull == null && string.IsNullOrEmpty(conditionValue)),
                "isNull(" + isNull + ") and conditionValue(" + (conditionValue == null ? "NULL" : conditionValue)
                + ") combination is incorrect");
            if (isNull == null)
            {
                cond.IsNull.Value = null;
                cond.Value.Value = conditionValue;
            }
            else
            {
                Debug.Assert(string.IsNullOrEmpty(conditionValue), "IsNull and Value condition predicates can't be set at the same time");
                cond.Value.Value = null;
                if (isNull == true)
                {
                    cond.IsNull.Value = Condition.IsNullConstant;
                }
                else
                {
                    cond.IsNull.Value = Condition.IsNotNullConstant;
                }
            }
        }
internal static void SetConditionPredicate ( Condition cond , bool ? isNull , string conditionValue ) { Debug . Assert ( cond != null , " " ) ; Debug . Assert ( ( isNull != null && string . IsNullOrEmpty ( conditionValue ) ) || ( isNull == null && string . IsNullOrEmpty ( conditionValue ) == false ) || ( isNull == null && string . IsNullOrEmpty ( conditionValue ) ) , " " + isNull + " " + ( conditionValue == null ? " " : conditionValue ) + " " ) ; if ( isNull == null ) { cond . IsNull . Value = null ; cond . Value . Value = conditionValue ; } else { Debug . Assert ( string . IsNullOrEmpty ( conditionValue ) , " " ) ; cond . Value . Value = null ; if ( isNull == true ) { cond . IsNull . Value = Condition . IsNullConstant ; } else { cond . IsNull . Value = Condition . IsNotNullConstant ; } } }
A method for setting either the Value or the IsNull attributes on a condition.
A method for setting either the Value or the IsNull attributes on a condition .
// this will cause the XAttribute to be removed // don't assert non-null Value here; condition fragments are created in this way // this will cause the XAttribute to be removed
cond
Condition
isNull
bool?
conditionValue
string