System.Data.Common.CommandTrees.DbExpression.Or(System.Data.Common.CommandTrees.DbExpression)

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

10 Examples 7

1. Example

Project: referencesource
Source File: Translator.cs
protected override DbExpression TranslateBinary(ExpressionConverter parent, DbExpression left, DbExpression right, BinaryExpression linq)
            {
                return left.Or(right);
            }

2. Example

Project: referencesource
Source File: Translator.cs
protected override DbExpression TranslateIntoLogicExpression(ExpressionConverter parent, System.Linq.Expressions.BinaryExpression linq, DbExpression left, DbExpression right)
            {
                return left.Or(right);
            }

3. Example

Project: referencesource
Source File: Translator.cs
protected override DbExpression TranslateIntoLogicExpression(ExpressionConverter parent, System.Linq.Expressions.BinaryExpression linq, DbExpression left, DbExpression right)
            {
                //No direct translation, we translate into ((left && !right) || (!left && right))
                DbExpression firstExpression = left.And(right.Not());
                DbExpression secondExpression = left.Not().And(right);
                DbExpression result = firstExpression.Or(secondExpression);
                return result;
            }

4. Example

Project: referencesource
Source File: MethodCallTranslator.cs
internal override CqtExpression Translate(ExpressionConverter parent, MethodCallExpression call)
                {
                    Debug.Assert(call.Arguments.Count == 1, "Expecting 1 argument for String.IsNullOrEmpty");

                    //IsNull(value)
                    DbExpression value = parent.TranslateExpression(call.Arguments[0]);
                    CqtExpression isNullExpression = value.IsNull();

                    //Length(value) = 0
                    CqtExpression emptyStringExpression =
                        parent.CreateCanonicalFunction(ExpressionConverter.Length, call, value)
                        .Equal(DbExpressionBuilder.Constant(0));
                        
                    CqtExpression result = isNullExpression.Or(emptyStringExpression);
                    return result;
                }

5. Example

Project: referencesource
Source File: CTreeGenerator.cs
public override DbExpression Visit(ConditionalOp op, Node n)
        {
            //
            ///n ..... /n //View Source file for more details /n }

6. Example

Project: referencesource
Source File: ScalarRestriction.cs
internal override DbExpression AsCqt(DbExpression row, bool skipIsNotNull)
        {
            DbE/n ..... /n //View Source file for more details /n }

7. Example

Project: referencesource
Source File: ExpressionConverter.cs
private DbExpression ImplementEqualityUnknownArguments(DbExpression left, DbExpression right, EqualsPattern pattern)
        {
            switch (pattern)
            {
                case EqualsPattern.Store: // left EQ right
                    return left.Equal(right);
                case EqualsPattern.PositiveNullEqualityNonComposable: // for Joins
                    return left.Equal(right).Or(left.IsNull().And(right.IsNull()));
                case EqualsPattern.PositiveNullEqualityComposable:
                    {
                        var bothNotNull = left.Equal(right);
                        var bothNull = left.IsNull().And(right.IsNull());
                        if (!_funcletizer.RootContext.ContextOptions.UseCSharpNullComparisonBehavior)
                        {
                            return bothNotNull.Or(bothNull); // same as EqualsPattern.PositiveNullEqualityNonComposable
                        }
                        // add more logic to avoid undefined result for true clr semantics, ensuring composability
                        // (left EQ right AND NOT (left IS NULL OR right IS NULL)) OR (left IS NULL AND right IS NULL)
                        var anyOneIsNull = left.IsNull().Or(right.IsNull());
                        return (bothNotNull.And(anyOneIsNull.Not())).Or(bothNull);
                    }
                default:
                    Debug.Fail("unexpected pattern");
                    return null;
            }
        }

8. Example

Project: referencesource
Source File: MethodCallTranslator.cs
internal static DbExpression TranslateContains(ExpressionConverter parent, Expression sourceExpressi/n ..... /n //View Source file for more details /n }

9. Example

Project: referencesource
Source File: Sql8ExpressionRewriter.cs
private DbExpression TransformIntersectOrExcept(DbExpression left, DbExpression right, DbExpressionK/n ..... /n //View Source file for more details /n }

10. Example

Project: referencesource
Source File: SemanticAnalyzer.cs
private static Dictionary<AST.BuiltInKind, BuiltInExprConverter> CreateBuiltInExprConverter()
/n ..... /n //View Source file for more details /n }