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

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

3 Examples 7

1. Example

Project: referencesource
Source File: MethodCallTranslator.cs
protected override CqtExpression TranslateOneLambda(ExpressionConverter parent, DbExpressionBinding sourceBinding, CqtExpression lambda)
                {
                    List<DbSortClause> keys = new List<DbSortClause>(1);
                    DbSortClause sortSpec = (_ascending ? lambda.ToSortClause() : lambda.ToSortClauseDescending());
                    keys.Add(sortSpec);
                    DbSortExpression sort = parent.Sort(sourceBinding, keys);
                    return sort;
                }

2. Example

Project: referencesource
Source File: CTreeGenerator.cs
private List<DbSortClause> VisitSortKeys(IList<InternalTrees.SortKey> sortKeys)
        {
            VarVec sortVars = _iqtCommand.CreateVarVec();
            List<DbSortClause> sortClauses = new List<DbSortClause>();
            foreach (InternalTrees.SortKey sortKey in sortKeys)
            {
                //
                // If we've already seen the same Var, then ignore it
                //
                if (sortVars.IsSet(sortKey.Var))
                {
                    continue;
                }
                else
                {
                    sortVars.Set(sortKey.Var);
                }

                DbSortClause sortClause = null;
                DbExpression keyExpression = ResolveVar(sortKey.Var);
                if (!string.IsNullOrEmpty(sortKey.Collation))
                {

                    sortClause = (sortKey.AscendingSort ? keyExpression.ToSortClause(sortKey.Collation) : keyExpression.ToSortClauseDescending(sortKey.Collation));
                }
                else
                {
                    sortClause = (sortKey.AscendingSort ? keyExpression.ToSortClause() : keyExpression.ToSortClauseDescending());
                }

                sortClauses.Add(sortClause);
            }

            return sortClauses;
        }

3. Example

Project: referencesource
Source File: SemanticAnalyzer.cs
private static DbExpressionBinding ProcessOrderByClause(DbExpressionBinding source, AST.QueryExpr qu/n ..... /n //View Source file for more details /n }