/
DbUnaryExpression.cs
45 lines (40 loc) · 1.35 KB
/
DbUnaryExpression.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
using System;
namespace DevZest.Data.Primitives
{
/// <summary>
/// Represents database expression which has single operand.
/// </summary>
public sealed class DbUnaryExpression : DbExpression
{
/// <summary>
/// Initializes a new instance of <see cref="DbUnaryExpression"/> class.
/// </summary>
/// <param name="dataType">The data type.</param>
/// <param name="kind">Specifies the operation of the expression.</param>
/// <param name="operand">The operand of the expression.</param>
public DbUnaryExpression(Type dataType, DbUnaryExpressionKind kind, DbExpression operand)
: base(dataType)
{
Kind = kind;
Operand = operand;
}
/// <summary>
/// Gets the operation of the expression.
/// </summary>
public DbUnaryExpressionKind Kind { get; private set; }
/// <summary>
/// Gets the operand of the expression.
/// </summary>
public DbExpression Operand { 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);
}
}
}