/
DbBinaryExpression.cs
55 lines (48 loc) · 1.69 KB
/
DbBinaryExpression.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using System;
namespace DevZest.Data.Primitives
{
/// <summary>
/// Represents database expression which has two expression operands.
/// </summary>
public sealed class DbBinaryExpression : DbExpression
{
/// <summary>
/// Initializes a new instance <see cref="DbBinaryExpression"/> class.
/// </summary>
/// <param name="dataType">The data type.</param>
/// <param name="kind">Specifies the operation of the expression.</param>
/// <param name="left">The left expression operand.</param>
/// <param name="right">The right expression operand.</param>
public DbBinaryExpression(Type dataType, BinaryExpressionKind kind, DbExpression left, DbExpression right)
: base(dataType)
{
left.VerifyNotNull(nameof(left));
right.VerifyNotNull(nameof(right));
Kind = kind;
Left = left;
Right = right;
}
/// <summary>
/// Gets the operation of the expression.
/// </summary>
public BinaryExpressionKind Kind { get; private set; }
/// <summary>
/// Gets the left expression operand.
/// </summary>
public DbExpression Left { get; private set; }
/// <summary>
/// Gets the right expression operand.
/// </summary>
public DbExpression Right { get; private set; }
/// <inheritdoc />
public override void Accept(DbExpressionVisitor visitor)
{
visitor.Visit(this);
}
/// <inheritdoc />
public override T Accept<T>(DbExpressionVisitor<T> visitor)
{
return visitor.Visit(this);
}
}
}