本文整理汇总了C#中DbSkipExpression类的典型用法代码示例。如果您正苦于以下问题:C# DbSkipExpression类的具体用法?C# DbSkipExpression怎么用?C# DbSkipExpression使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DbSkipExpression类属于命名空间,在下文中一共展示了DbSkipExpression类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Visit
public override Expression Visit(DbSkipExpression expression)
{
Expression source = this.Visit(expression.Input.Expression);
Type sourceType = TypeHelper.GetElementType(source.Type);
// Skip cannot be used without sorting
Expression result = this.CreateOrderByExpression(expression.SortOrder, expression.Input.VariableName, source);
return queryMethodExpressionBuilder.Skip(result, this.Visit(expression.Count, typeof(int)));
}
开发者ID:DeadlyEmbrace,项目名称:effort,代码行数:10,代码来源:TransformVisitor.Skip.cs
示例2: Visit
/// <summary>
/// Implements the visitor pattern for <see cref="T:System.Data.Common.CommandTrees.DbSkipExpression"/>.
/// </summary>
/// <param name="expression">The <see cref="T:System.Data.Common.CommandTrees.DbSkipExpression"/> that is visited.</param>
public override void Visit(DbSkipExpression expression)
{
if (expression == null)
{
throw new ArgumentNullException("expression");
}
expression.Count.Accept(this);
expression.Input.Expression.Accept(this);
foreach (var sortClause in expression.SortOrder)
{
sortClause.Expression.Accept(this);
}
}
开发者ID:raovat,项目名称:develop,代码行数:18,代码来源:DbCommandTreeScanner.cs
示例3: SkipLifter
internal SkipLifter(DbSkipExpression skip, AliasGenerator aliasGenerator)
: base(skip, aliasGenerator)
{
_skip = skip;
_source = skip.Input.Expression;
}
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:6,代码来源:OrderByLifter.cs
示例4: ProjectSkipLifter
internal ProjectSkipLifter(DbProjectExpression project, DbSkipExpression skip, AliasGenerator aliasGenerator)
: base(project, aliasGenerator)
{
_project = project;
_skip = skip;
_source = _skip.Input.Expression;
}
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:7,代码来源:OrderByLifter.cs
示例5: LimitSkipLifter
internal LimitSkipLifter(DbLimitExpression limit, DbSkipExpression skip, AliasGenerator aliasGenerator)
: base(limit, aliasGenerator)
{
_limit = limit;
_skip = skip;
_source = skip.Input.Expression;
}
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:7,代码来源:OrderByLifter.cs
示例6: Visit
public override DbExpression Visit(DbSkipExpression expression)
{
Check.NotNull(expression, "expression");
var found = Find(expression.Input.Expression);
if (!ReferenceEquals(found, expression.Input.Expression))
{
return found.BindAs(expression.Input.VariableName).Skip(expression.SortOrder, expression.Count);
}
else
{
return expression;
}
}
开发者ID:christiandpena,项目名称:entityframework,代码行数:14,代码来源:ObjectSpanRewriter.cs
示例7: Visit
public override SqlFragment Visit(DbSkipExpression expression)
{
SelectStatement select = VisitInputExpressionEnsureSelect(expression.Input.Expression, expression.Input.VariableName,
expression.Input.VariableType);
foreach (DbSortClause sortClause in expression.SortOrder)
{
select.AddOrderBy(
new SortFragment(sortClause.Expression.Accept(this), sortClause.Ascending));
}
select = WrapIfNotCompatible(select, expression.ExpressionKind);
select.Skip = expression.Count.Accept(this);
return select;
}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:16,代码来源:SelectGenerator.cs
示例8: Visit
/// <summary>
/// Logicaly, <see cref="DbSkipExpression"/> translates to:
/// SELECT Y.x1, Y.x2, ..., Y.xn
/// FROM (
/// SELECT X.x1, X.x2, ..., X.xn,
/// FROM input AS X
/// EXCEPT
/// SELECT TOP(count) Z.x1, Z.x2, ..., Z.xn
/// FROM input AS Z
/// ORDER BY sk1, sk2, ...
/// ) AS Y
/// ORDER BY sk1, sk2, ...
///
/// Here, input refers to the input of the <see cref="DbSkipExpression"/>, and count to the count property of the <see cref="DbSkipExpression"/>.
/// The implementation of EXCEPT is non-duplicate eliminating, and does equality comparison only over the
/// equality comparable columns of the input.
///
/// This corresponds to the following expression tree:
///
/// SORT
/// |
/// NON-DISTINCT EXCEPT (specially translated, <see cref="TransformIntersectOrExcept(DbExpression left, DbExpression right, DbExpressionKind expressionKind, IList<DbPropertyExpression> sortExpressionsOverLeft, string sortExpressionsBindingVariableName)"/>
/// |
/// | - Left: clone of input
/// | - Right:
/// |
/// Limit
/// |
/// | - Limit: Count
/// | - Input
/// |
/// Sort
/// |
/// input
///
/// </summary>
/// <param name="e"></param>
/// <returns></returns>
public override DbExpression Visit(DbSkipExpression e)
{
//Build the right input of the except
DbExpression rightInput = VisitExpressionBinding(e.Input).Sort(VisitSortOrder(e.SortOrder)).Limit(VisitExpression(e.Count));
//Build the left input for the except
var leftInput = VisitExpression(e.Input.Expression); //Another copy of the input
var sortOrder = VisitSortOrder(e.SortOrder); //Another copy of the sort order
// Create a list of the sort expressions to be used for translating except
IList<DbPropertyExpression> sortExpressions = new List<DbPropertyExpression>(e.SortOrder.Count);
foreach (var sortClause in sortOrder)
{
//We only care about property expressions, not about constants
if (sortClause.Expression.ExpressionKind
== DbExpressionKind.Property)
{
sortExpressions.Add((DbPropertyExpression)sortClause.Expression);
}
}
var exceptExpression = TransformIntersectOrExcept(
leftInput, rightInput, DbExpressionKind.Skip, sortExpressions, e.Input.VariableName);
DbExpression result = exceptExpression.BindAs(e.Input.VariableName).Sort(sortOrder);
return result;
}
开发者ID:jimmy00784,项目名称:entityframework,代码行数:67,代码来源:Sql8ExpressionRewriter.cs
示例9: Visit
public override void Visit(DbSkipExpression expression)
{
throw new NotSupportedException("Visit(\"SkipExpression\") is not supported.");
}
开发者ID:Outlivier,项目名称:FirebirdSql.Data.FirebirdClient,代码行数:4,代码来源:ExpressionTranslator.cs
示例10: Visit
/// <summary>
/// Visitor pattern method for DbSkipExpression.
/// </summary>
/// <param name="expression"> The DbSkipExpression that is being visited. </param>
public abstract void Visit(DbSkipExpression expression);
开发者ID:junxy,项目名称:entityframework,代码行数:5,代码来源:DbExpressionVisitor.cs
示例11: Visit
/// <summary>
/// Visitor pattern method for <see cref="DbSkipExpression"/>.
/// </summary>
/// <param name="expression">The DbSkipExpression that is being visited.</param>
/// <exception cref="ArgumentNullException"><paramref name="expression"/> is null</exception>
public override void Visit(DbSkipExpression expression)
{
// #433613: PreSharp warning 56506: Parameter 'expression' to this public method must be validated: A null-dereference can occur here.
EntityUtil.CheckArgumentNull(expression, "expression");
VisitExpressionBindingPre(expression.Input);
foreach (DbSortClause sortKey in expression.SortOrder)
{
VisitExpression(sortKey.Expression);
}
VisitExpressionBindingPost(expression.Input);
VisitExpression(expression.Count);
}
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:18,代码来源:BasicExpressionVisitor.cs
示例12: Visit
public override void Visit(DbSkipExpression e)
{
Begin(e);
Dump(e.Input, "Input");
Dump(e.SortOrder);
Dump(e.Count, "Count");
End(e);
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:8,代码来源:ExpressionDumper.cs
示例13: Visit
public override void Visit(DbSkipExpression expression) { }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:1,代码来源:DbExpressionVisitorTests.cs
示例14: Visit
public override void Visit(DbSkipExpression e)
{
Check.NotNull(e, "e");
Begin(e);
Dump(e.Input, "Input");
Dump(e.SortOrder);
Dump(e.Count, "Count");
End(e);
}
开发者ID:christiandpena,项目名称:entityframework,代码行数:10,代码来源:ExpressionDumper.cs
示例15: Visit
public override DbExpression Visit(DbSkipExpression expression)
{
DbExpression found = Find(expression.Input.Expression);
if (!object.ReferenceEquals(found, expression.Input.Expression))
{
return found.BindAs(expression.Input.VariableName).Skip(expression.SortOrder, expression.Count);
}
else
{
return expression;
}
}
开发者ID:uQr,项目名称:referencesource,代码行数:12,代码来源:ObjectSpanRewriter.cs
示例16: Visit
/// <summary>
/// Visitor pattern method for <see cref="DbSkipExpression" />.
/// </summary>
/// <param name="expression"> The DbLimitExpression that is being visited. </param>
/// <exception cref="ArgumentNullException">
/// <paramref name="expression" />
/// is null
/// </exception>
public override void Visit(DbSkipExpression expression)
{
Check.NotNull(expression, "expression");
VisitExpressionBindingPre(expression.Input);
foreach (var s in expression.SortOrder)
{
VisitExpression(s.Expression);
}
VisitExpressionBindingPost(expression.Input);
VisitExpression(expression.Count);
}
开发者ID:jwanagel,项目名称:jjwtest,代码行数:21,代码来源:BasicExpressionVisitor.cs
示例17: AddToSkip
protected DbSkipExpression AddToSkip(DbExpression input, DbSkipExpression skip, DbExpression plusK)
{
// source.Skip(k, o).Skip(k2) -> source.Skip(k + k2, o)
DbExpression newCount = CombineIntegers(skip.Count, plusK,
(l, r) => l + r);
return RebindSkip(input, skip, newCount);
}
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:7,代码来源:OrderByLifter.cs
示例18: Visit
public override SqlFragment Visit(DbSkipExpression expression)
{
SelectStatement select = VisitInputExpressionEnsureSelect(expression.Input.Expression, expression.Input.VariableName,
expression.Input.VariableType);
select = WrapIfNotCompatible(select, DbExpressionKind.Sort);
foreach (DbSortClause sortClause in expression.SortOrder)
{
select.AddOrderBy(
new SortFragment(sortClause.Expression.Accept(this), sortClause.Ascending));
}
// if we wrapped above, then this wrap will not create a new one so there
// is no harm in calling it
select = WrapIfNotCompatible(select, expression.ExpressionKind);
select.Skip = expression.Count.Accept(this);
return select;
}
开发者ID:brunolauze,项目名称:mysql-connector-net-6,代码行数:18,代码来源:SelectGenerator.cs
示例19: ApplySkipOrderToSort
protected DbSortExpression ApplySkipOrderToSort(DbExpression input, DbSkipExpression sortSpec)
{
DbExpressionBinding inputBinding = input.BindAs(sortSpec.Input.VariableName);
return inputBinding.Sort(sortSpec.SortOrder);
}
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:5,代码来源:OrderByLifter.cs
示例20: Visit
public override void Visit(DbSkipExpression e)
{
VisitExprKind(e.ExpressionKind);
_key.Append('(');
VisitBinding(e.Input);
VisitSortOrder(e.SortOrder);
_key.Append('(');
e.Count.Accept(this);
_key.Append("))");
}
开发者ID:jimmy00784,项目名称:entityframework,代码行数:10,代码来源:ExpressionKeyGen.cs
注:本文中的DbSkipExpression类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论