Remotion.Linq.SqlBackend.MappingResolution.SqlContextExpressionVisitor.CreateValueExpressionForPredicate C# (CSharp) Метод

CreateValueExpressionForPredicate() приватный Метод

private CreateValueExpressionForPredicate ( Expression predicate ) : Expression
predicate System.Linq.Expressions.Expression
Результат System.Linq.Expressions.Expression
    private Expression CreateValueExpressionForPredicate (Expression predicate)
    {
      // If the predicate is nullable, we have three cases (true, false, null). Otherweise, we just have two cases.
      if (predicate.Type == typeof (bool?))
        return SqlCaseExpression.CreateIfThenElseNull (typeof (int?), predicate, new SqlLiteralExpression (1), new SqlLiteralExpression (0));
      else
        return SqlCaseExpression.CreateIfThenElse (typeof (int), predicate, new SqlLiteralExpression (1), new SqlLiteralExpression (0));
    }
  }