Enum ExpressionOptions
- Namespace
- NCalc
- Assembly
- NCalc.Core.dll
Flag-based options that can be converted to ExpressionConfiguration.
[Flags]
public enum ExpressionOptions
Fields
[Display(Name = "Allow Boolean Calculation")] AllowBooleanCalculation = 512Allows arithmetic operations with bool values.
Converts to AllowBooleanCalculation.
[Display(Name = "Allow Char Values")] AllowCharValues = 4096Parses single-quoted one-character values as char.
Converts to AllowCharValues.
[Display(Name = "Allow Null Or Empty Expressions")] AllowNullOrEmptyExpressions = 16384Allows null or empty expression text to evaluate without throwing.
Converts to AllowNullOrEmptyExpressions.
[Display(Name = "Allow Null Parameter")] AllowNullParameter = 128Allows the identifier
nullto resolve to a null value during evaluation.Converts to AllowNullParameter.
[Display(Name = "Arithmetic Null Or Empty String As Zero")] ArithmeticNullOrEmptyStringAsZero = 131072Converts null or empty string values to zero during arithmetic operations.
Converts to ArithmeticNullOrEmptyStringAsZero.
[Display(Name = "Case-Insensitive String Comparer")] CaseInsensitiveStringComparer = 32Gets the string comparer used for string comparisons.
Converts to StringComparer as either CurrentCultureIgnoreCase or OrdinalIgnoreCase, using a case-insensitive string comparer for string comparisons, depending on OrdinalStringComparer.
[Display(Name = "Decimal As Default")] DecimalAsDefault = 64Converts to Decimal on parser options and FloatingPointNumberType on math options.
[Display(Name = "Ignore Case At Built-In Functions")] IgnoreCaseAtBuiltInFunctions = 2Enables case-insensitive matching for built-in function names.
Converts to IgnoreCaseAtBuiltInFunctions.
[Display(Name = "Iterate Parameters")] IterateParameters = 8Treats enumerable parameters as parallel value sequences and returns one result per item.
Converts to IterateParameters.
[Display(Name = "Long As Default")] LongAsDefault = 65536Converts to Int64 on parser options and IntegerNumberType on math options, unless DecimalAsDefault is also set.
[Display(Name = "No Cache")] NoCache = 4Enables parsed expression cache usage.
Converts to CacheEnabled set to false, disabling parsed expression cache usage.
[Display(Name = "No String Type Coercion")] NoStringTypeCoercion = 8192Disables coercion of string values to other types during evaluation.
Converts to NoStringTypeCoercion.
[Display(Name = "None")] None = 0No options are set.
[Display(Name = "Ordinal String Comparer")] OrdinalStringComparer = 256Gets the string comparer used for string comparisons.
Converts to StringComparer as either Ordinal or OrdinalIgnoreCase, using ordinal string comparison instead of current-culture comparison, depending on CaseInsensitiveStringComparer.
[Display(Name = "Overflow Protection")] OverflowProtection = 1024Checks arithmetic binary operations for overflow.
Converts to OverflowProtection.
[Display(Name = "Round Away From Zero")] RoundAwayFromZero = 16Gets the midpoint rounding strategy.
Converts to MidpointRounding.
[Display(Name = "Strict Type Matching")] StrictTypeMatching = 32768Makes comparisons between values of different runtime types return false.
Converts to StrictTypeMatching.
[Display(Name = "String Concatenation")] StringConcat = 2048Concatenates values as strings instead of attempting arithmetic addition.
Converts to StringConcat.
Remarks
Prefer configuring new code with ExpressionConfiguration, LogicalExpressionParserOptions, ExpressionEvaluationOptions, and MathOptions directly. This enum is kept as a compatibility helper for older code paths and is converted by FromOptions(ExpressionOptions).