System.Data.Common.CommandTrees.DefaultExpressionVisitor.VisitUnary(System.Data.Common.CommandTrees.DbUnaryExpression, System.Func)

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

8 Examples 7

1. Example

View license
public override DbExpression Visit(DbNotExpression expression)
        {
            EntityUtil.CheckArgumentNull(expression, "expression");

            return VisitUnary(expression, CqtBuilder.Not);
        }

2. Example

View license
public override DbExpression Visit(DbDistinctExpression expression)
        {
            EntityUtil.CheckArgumentNull(expression, "expression");

            return VisitUnary(expression, CqtBuilder.Distinct);
        }

3. Example

View license
public override DbExpression Visit(DbElementExpression expression)
        {
            EntityUtil.CheckArgumentNull(expression, "expression");

            Func<DbExpression, DbExpression> resultConstructor;
            if (expression.IsSinglePropertyUnwrapped)
            {
                // 
                resultConstructor = CqtBuilder.CreateElementExpressionUnwrapSingleProperty;
            }
            else
            {
                resultConstructor = CqtBuilder.Element;
            }

            return VisitUnary(expression, resultConstructor);
        }

4. Example

View license
public override DbExpression Visit(DbIsEmptyExpression expression)
        {
            EntityUtil.CheckArgumentNull(expression, "expression");

            return VisitUnary(expression, CqtBuilder.IsEmpty);
        }

5. Example

View license
public override DbExpression Visit(DbDerefExpression expression)
        {
            EntityUtil.CheckArgumentNull(expression, "expression");

            return this.VisitUnary(expression, CqtBuilder.Deref);
        }

6. Example

View license
public override DbExpression Visit(DbRefKeyExpression expression)
        {
            EntityUtil.CheckArgumentNull(expression, "expression");

            return this.VisitUnary(expression, CqtBuilder.GetRefKey);
        }

7. Example

View license
public override DbExpression Visit(DbEntityRefExpression expression)
        {
            EntityUtil.CheckArgumentNull(expression, "expression");

            return this.VisitUnary(expression, CqtBuilder.GetEntityRef);
        }

8. Example

View license
public override DbExpression Visit(DbIsNullExpression expression)
        {
            EntityUtil.CheckArgumentNull(expression, "expression");

            return VisitUnary(expression, exp =>
                {
                    if(TypeSemantics.IsRowType(exp.ResultType))
                    {
                        // 
                        return CqtBuilder.CreateIsNullExpressionAllowingRowTypeArgument(exp);
                    }
                    else
                    {
                        return CqtBuilder.IsNull(exp);
                    }
                }
            );
        }