Here are the examples of the csharp api class System.Data.Common.CommandTrees.DbExpression.Element() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
4 Examples
0
1. Example
View licenseprivate DbExpression RewriteElementExpression(DbElementExpression expression) { DbExpression rewrittenInput = Rewrite(expression.Argument); if (!object.ReferenceEquals(expression.Argument, rewrittenInput)) { expression = rewrittenInput.Element(); } return expression; }
0
2. Example
View licenseprotected override CqtExpression TranslateUnary(ExpressionConverter parent, CqtExpression operand, MethodCallExpression call) { CqtExpression result = LimitResult(parent, operand); // If this FirstOrDefault/SingleOrDefault() operation is the root of the query, // then the evaluation is performed in the client over the resulting set, // to provide the same semantics as Linq to Objects. Otherwise, an Element // expression is applied to retrieve the single element (or null, if empty) // from the output set. if (!parent.IsQueryRoot(call)) { result = result.Element(); result = AddDefaultCase(parent, result, call.Type); } // Span is preserved over First/FirstOrDefault with or without a predicate Span inputSpan = null; if (parent.TryGetSpan(operand, out inputSpan)) { parent.AddSpanMapping(result, inputSpan); } return result; }
0
3. Example
View licenseinternal override CqtExpression Translate(ExpressionConverter parent, MethodCallExpression call) { // Convert the input set and the predicate into a filter expression CqtExpression input = base.Translate(parent, call); // If this First/FirstOrDefault/Single/SingleOrDefault is the root of the query, // then the actual result will be produced by evaluated by // calling First/Single() or FirstOrDefault() on the filtered input set, // which is limited to at most one element by applying a limit. if (parent.IsQueryRoot(call)) { // Calling ExpressionConverter.Limit propagates the Span. return RestrictResult(parent, input); } else { CqtExpression element = input.Element(); element = FirstTranslatorBase.AddDefaultCase(parent, element, call.Type); // Span is preserved over First/FirstOrDefault with or without a predicate Span inputSpan = null; if (parent.TryGetSpan(input, out inputSpan)) { parent.AddSpanMapping(element, inputSpan); } return element; } }
0
4. Example
View licensepublic override DbExpression Visit(SingleRowOp op, Node n) { RelOpInfo inputInfo/n ..... /n //View Source file for more details /n }