Here are the examples of the csharp api class System.Data.Common.CommandTrees.DbExpression.Distinct() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
8 Examples
0
1. Example
View licenseinternal override DbExpression AsCqt(bool isTopLevel) { // Get the FROM part. DbExpression cqt = m_extent.Scan(); // Get the WHERE part only when the expression is not simply TRUE. if (!BoolExpression.EqualityComparer.Equals(this.WhereClause, BoolExpression.True)) { cqt = cqt.Where(row => this.WhereClause.AsCqt(row)); } // The SELECT/DISTINCT part. cqt = cqt.Select(row => GenerateProjectionCqt(row, isTopLevel)); if (m_selectDistinct == CellQuery.SelectDistinct.Yes) { cqt = cqt.Distinct(); } return cqt; }
0
2. Example
View licenseprivate DbDistinctExpression Distinct(DbExpression argument) { DbDistinctExpression retExpr = argument.Distinct(); ApplySpanMapping(argument, retExpr); return retExpr; }
0
3. Example
View licensepublic override DbExpression Visit(DistinctOp op, Node n) { // // Build a projection above the input that gets the "keys" of the // DistinctOp. // RelOpInfo sourceInfo = BuildProjection(n.Child0, op.Keys); // // Build the Distinct expression now // DbExpression distinctExpr = sourceInfo.Publisher.Distinct(); // // Publish the DbDistinctExpression's Vars: // PublisherName: The next Distinct alias // PublishedVars: The PublishedVars of the Distinct are the same (rebound) Vars published by its input // PublishRelOp(_distinctAliases.Next(), distinctExpr, sourceInfo.PublishedVars); return distinctExpr; }
0
4. Example
View licenseprivate static DbExpression CreateProjectExpression(DbExpressionBinding source, AST.SelectClause selectClause, List<KeyValuePair<string, DbExpression>> projectionItems) { // // Create DbProjectExpression off the projectionItems. // DbExpression projectExpression; if (selectClause.SelectKind == AST.SelectKind.Value) { Debug.Assert(projectionItems.Count == 1, "projectionItems.Count must be 1 for SELECT VALUE"); projectExpression = source.Project(projectionItems[0].Value); } else { projectExpression = source.Project(DbExpressionBuilder.NewRow(projectionItems)); } // // Handle DISTINCT modifier - create DbDistinctExpression over the current projectExpression. // if (selectClause.DistinctKind == AST.DistinctKind.Distinct) { // // Ensure element type is equal-comparable. // ValidateDistinctProjection(projectExpression.ResultType, selectClause); // // Create distinct expression. // projectExpression = projectExpression.Distinct(); } return projectExpression; }
0
5. Example
View licenseprivate static ExpressionResolution ConvertGroupPartitionExpr(AST.Node astExpr, SemanticResolver sr)/n ..... /n //View Source file for more details /n }
0
6. Example
View licenseprivate DbExpression TransformIntersectOrExcept(DbExpression left, DbExpression right, DbExpressionK/n ..... /n //View Source file for more details /n }
0
7. Example
View licenseprivate DbExpression ApplyIsOfFilter(DbExpression current, IsOfFilter typeFilter) { /n ..... /n //View Source file for more details /n }
0
8. Example
View licenseprivate static Dictionary<AST.BuiltInKind, BuiltInExprConverter> CreateBuiltInExprConverter() /n ..... /n //View Source file for more details /n }