Open sandboxFocus

Method WithNullability

WithNullability(IExpression, bool)

Returns the same expression, but assuming it has a different nullability. This method does not generate any cast (unlike CastTo(IExpression, IType)) and should only be used when the of the nullability given expression is wrongly infered.

Declaration
public static IExpression WithNullability(this IExpression expression, bool isNullable)
Parameters
Type Name Description
IExpression expression
bool isNullable
Returns
Type Description
IExpression