Class NullSafeStringMatch
In C#, string matching would throw an exception for null strings. To prevent that, we make sure to only apply StringMatches to non-null strings.
Inheritance
NullSafeStringMatch
Implements
Inherited Members
Namespace: Mangrove.MetricSetTransformers.Normalization
Assembly: MetricSetTransformers.dll
Syntax
public class NullSafeStringMatch : ChangeExpressions, IGenericExpressionVisitor<IEnumerable<Expression>>, IExpressionVisitor, IGenericVisitor<IEnumerable<Expression>>
Remarks
More precisely, given an expression like
StringMatches(str,pattern)
convert it to
IsNull(str) ? false : StringMatches(str,pattern)
to avoid run-time exceptions when applying matching to null value.
Methods
View SourceChange(BinaryOperation)
Declaration
protected override Expression Change(BinaryOperation bo)
Parameters
Type | Name | Description |
---|---|---|
BinaryOperation | bo |
Returns
Type | Description |
---|---|
Expression |