System.Data.Common.CommandTrees.Internal.ViewSimplifier.FlattenOr(System.Data.Common.CommandTrees.DbExpression)

Here are the examples of the csharp api class System.Data.Common.CommandTrees.Internal.ViewSimplifier.FlattenOr(System.Data.Common.CommandTrees.DbExpression) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

1. Example

Project: referencesource
Source File: ViewSimplifier.cs
View license
internal static bool TryMatchDiscriminatorPredicate(DbFilterExpression filter, Action<DbComparisonExpression, object> onMatchedComparison)
        {
            EdmProperty discriminatorProperty = null;

            // check each assignment in predicate
            foreach (var term in FlattenOr(filter.Predicate))
            {
                DbPropertyExpression currentDiscriminator;
                object discriminatorValue;
                if (!TryMatchPropertyEqualsValue(term, filter.Input.VariableName, out currentDiscriminator, out discriminatorValue))
                {
                    return false;
                }

                // must be the same discriminator in every case
                if (null == discriminatorProperty)
                {
                    discriminatorProperty = (EdmProperty)currentDiscriminator.Property;
                }
                else if (discriminatorProperty != currentDiscriminator.Property)
                {
                    return false;
                }

                onMatchedComparison((DbComparisonExpression)term, discriminatorValue);
            }

            return true;
        }

2. Example

Project: referencesource
Source File: ViewSimplifier.cs
View license
private static DbExpression SimplifyNestedTphDiscriminator(DbExpression expression)
        {
      /n ..... /n //View Source file for more details /n }