|
|
|
@ -3,6 +3,7 @@ using Connected.Expressions.Formatters;
|
|
|
|
|
using Connected.Expressions.Translation;
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
using System.Linq.Expressions;
|
|
|
|
|
using System.Runtime.ExceptionServices;
|
|
|
|
|
|
|
|
|
|
namespace Connected.Expressions;
|
|
|
|
|
|
|
|
|
@ -43,4 +44,26 @@ public sealed class SelectExpression : AliasedExpression
|
|
|
|
|
public Expression? Take { get; }
|
|
|
|
|
public bool IsReverse { get; }
|
|
|
|
|
public string QueryText => SqlFormatter.Format(this);
|
|
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
|
{
|
|
|
|
|
return HashCode.Combine(HashCode.Combine(Alias, Columns, From, Where, OrderBy), GroupBy, IsDistinct, Skip, Take, IsReverse);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool Equals(object? obj)
|
|
|
|
|
{
|
|
|
|
|
if (obj is not SelectExpression second)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return Alias.Equals(second.Alias)
|
|
|
|
|
&& Columns.Equals(second.Columns)
|
|
|
|
|
&& From.Equals(second.From)
|
|
|
|
|
&& Where == second.Where
|
|
|
|
|
&& OrderBy == second.OrderBy
|
|
|
|
|
&& GroupBy == second.GroupBy
|
|
|
|
|
&& IsDistinct == second.IsDistinct
|
|
|
|
|
&& Skip == second.Skip
|
|
|
|
|
&& Take == second.Take
|
|
|
|
|
&& IsReverse == second.IsReverse;
|
|
|
|
|
}
|
|
|
|
|
}
|