Wrap evaluation exceptions at NCalcEvaluationException by @gumbarros in #565
Add new constructors overloads to ExpressionContext.cs. by @gumbarros in #566
Added ToExpressionString and ParameterSubstitutionVisitor by @gumbarros in #567
Rename CancellationToken parameters from ct to cancellationToken to align with Microsoft naming conventions. by @gumbarros in #568
Breaking Changes
Public domain types moved out of the NCalc.Domain namespace and into NCalc. For example, use NCalc.LogicalExpression, NCalc.BinaryExpression, NCalc.Function, and NCalc.ValueExpression instead of NCalc.Domain.*.
Parser types now live in the new NCalc.Parser assembly. Projects that use parser APIs directly must reference NCalc.Parser and NCalc.Domain in addition to NCalc.Core when those assemblies are not brought in transitively.
ArgumentSeparator was renamed to LogicalExpressionArgumentSeparator. LogicalExpressionParserOptions no longer exposes Default, WithCultureInfo, WithArgumentSeparator, Create, or the implicit CultureInfo conversion; use object initialization or the new constructors instead.
Sync and async evaluation were unified in NCalc.Core. AsyncExpression, AsyncExpressionContext, IAsyncExpressionFactory, AsyncExpressionFactory, IAsyncEvaluationVisitorFactory, AsyncEvaluationVisitorFactory, and AsyncEvaluationVisitor were removed; use Expression, ExpressionContext, IExpressionFactory, IEvaluationVisitorFactory, and Expression.EvaluateAsync instead.
Async DI customization methods were removed from NCalcServiceBuilder: use WithExpressionFactory and WithEvaluationVisitorFactory instead of WithAsyncExpressionFactory and WithAsyncEvaluationVisitorFactory.
Function and parameter callback delegates and argument types now use unified types in NCalc.Handlers. FunctionArgs, ParameterArgs, ExpressionFunctionData, ExpressionParameterData, AsyncFunctionArgs, AsyncParameterArgs, AsyncExpressionFunctionData, and AsyncExpressionParameterData were replaced by FunctionEventArgs, ParameterEventArgs, FunctionData, and ParameterData.
Function callback arguments no longer expose arrays of nested Expression or AsyncExpression instances. FunctionData exposes LogicalExpression arguments and provides Evaluate(index) / EvaluateAsync(index) helpers for evaluating them with the current ExpressionContext.
AsyncExpressionFunction now returns Task<object?> and receives FunctionData. AsyncExpressionParameter was removed; dynamic parameters now use ExpressionParameter.
ExpressionBase<TExpressionContext> and ExpressionContextBase were removed. Custom expression types should derive from or compose Expression and use ExpressionContext.
LogicalExpression.ToString() no longer serializes the expression tree. Use ToExpressionString() from NCalc.Extensions when an expression string representation is required.
Public CancellationToken parameter names were renamed from ct to cancellationToken. Calls that use named arguments must be updated.
Evaluation failures may now be wrapped in NCalcEvaluationException; inspect InnerException for the original exception.
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [NCalcSync](https://github.com/ncalc/ncalc) | nuget | major | `5.12.0` → `6.3.2` |
---
### Release Notes
<details>
<summary>ncalc/ncalc (NCalcSync)</summary>
### [`v6.3.2`](https://github.com/ncalc/ncalc/blob/HEAD/CHANGELOG.md#632)
- Fix numeric type coercion in `in` comparisons by [@​gumbarros](https://github.com/gumbarros) in [#​587](https://github.com/ncalc/ncalc/pull/587)
### [`v6.3.1`](https://github.com/ncalc/ncalc/blob/HEAD/CHANGELOG.md#631)
- Changed `LogicalExpressionList` to implement `IReadOnlyList` instead of `IList` for improved performance by [@​george-domingos](https://github.com/george-domingos) in [#​585](https://github.com/ncalc/ncalc/pull/585)
### [`v6.3.0`](https://github.com/ncalc/ncalc/blob/HEAD/CHANGELOG.md#630)
- Refactor: Restore dedicated sync evaluation path due reported performance regression by [@​gumbarros](https://github.com/gumbarros) in [#​577](https://github.com/ncalc/ncalc/pull/577)
- Refactor cancellation token usage by [@​gumbarros](https://github.com/gumbarros) in [#​579](https://github.com/ncalc/ncalc/pull/579)
- Add GetBuiltInFunctionNames method by [@​george-domingos](https://github.com/george-domingos) in [#​581](https://github.com/ncalc/ncalc/pull/581)
- Move 'if', 'in' functions to the top of Evaluate and EvaluateAsync in BultiIn by [@​george-domingos](https://github.com/george-domingos) in [#​582](https://github.com/ncalc/ncalc/pull/582)
### [`v6.2.0`](https://github.com/ncalc/ncalc/blob/HEAD/CHANGELOG.md#620)
- Feature/evaluate binary handler by [@​george-domingos](https://github.com/george-domingos) in [#​576](https://github.com/ncalc/ncalc/pull/576)
### [`v6.1.1`](https://github.com/ncalc/ncalc/blob/HEAD/CHANGELOG.md#611)
- Fix factorial input bounds and overflow handling by [@​gumbarros](https://github.com/gumbarros) and [@​pawlos](https://github.com/pawlos) in [#​575](https://github.com/ncalc/ncalc/pull/575)
### [`v6.1.0`](https://github.com/ncalc/ncalc/blob/HEAD/CHANGELOG.md#610)
- Refactor math numeric helpers into source generators by [@​gumbarros](https://github.com/gumbarros) in [#​570](https://github.com/ncalc/ncalc/pull/570)
- Fix IEEE-754 NaN comparisons and unary negation semantics by [@​gumbarros](https://github.com/gumbarros) in [#​571](https://github.com/ncalc/ncalc/pull/571)
### [`v6.0.0`](https://github.com/ncalc/ncalc/blob/HEAD/CHANGELOG.md#600)
- Unify sync and async paths into NCalc.Core by [@​gumbarros](https://github.com/gumbarros) in [#​559](https://github.com/ncalc/ncalc/pull/559)
- Refactor: Split parser and domain into dedicated assemblies by [@​gumbarros](https://github.com/gumbarros) in [#​560](https://github.com/ncalc/ncalc/pull/560)
- Refactor `EvaluationVisitor` removing `Lazy` to optimize binary expression handling. by [@​gumbarros](https://github.com/gumbarros) in [#​561](https://github.com/ncalc/ncalc/pull/561)
- Refactor function and parameter events to not depend on `Expression` and better handle null parameter. by [@​gumbarros](https://github.com/gumbarros) in [#​562](https://github.com/ncalc/ncalc/pull/562)
- Improve default expression cache by [@​gumbarros](https://github.com/gumbarros) in [#​563](https://github.com/ncalc/ncalc/pull/563)
- Fix minor docs issue at operators.md. This closes [#​549](https://github.com/ncalc/ncalc/issues/549) by [@​gumbarros](https://github.com/gumbarros) in [#​564](https://github.com/ncalc/ncalc/pull/564)
- Wrap evaluation exceptions at `NCalcEvaluationException` by [@​gumbarros](https://github.com/gumbarros) in [#​565](https://github.com/ncalc/ncalc/pull/565)
- Add new constructors overloads to `ExpressionContext.cs`. by [@​gumbarros](https://github.com/gumbarros) in [#​566](https://github.com/ncalc/ncalc/pull/566)
- Added `ToExpressionString` and `ParameterSubstitutionVisitor` by [@​gumbarros](https://github.com/gumbarros) in [#​567](https://github.com/ncalc/ncalc/pull/567)
- Rename `CancellationToken` parameters from ct to cancellationToken to align with Microsoft naming conventions. by [@​gumbarros](https://github.com/gumbarros) in [#​568](https://github.com/ncalc/ncalc/pull/568)
#### Breaking Changes
- Public domain types moved out of the `NCalc.Domain` namespace and into `NCalc`. For example, use `NCalc.LogicalExpression`, `NCalc.BinaryExpression`, `NCalc.Function`, and `NCalc.ValueExpression` instead of `NCalc.Domain.*`.
- Parser types now live in the new `NCalc.Parser` assembly. Projects that use parser APIs directly must reference `NCalc.Parser` and `NCalc.Domain` in addition to `NCalc.Core` when those assemblies are not brought in transitively.
- `ArgumentSeparator` was renamed to `LogicalExpressionArgumentSeparator`. `LogicalExpressionParserOptions` no longer exposes `Default`, `WithCultureInfo`, `WithArgumentSeparator`, `Create`, or the implicit `CultureInfo` conversion; use object initialization or the new constructors instead.
- Sync and async evaluation were unified in `NCalc.Core`. `AsyncExpression`, `AsyncExpressionContext`, `IAsyncExpressionFactory`, `AsyncExpressionFactory`, `IAsyncEvaluationVisitorFactory`, `AsyncEvaluationVisitorFactory`, and `AsyncEvaluationVisitor` were removed; use `Expression`, `ExpressionContext`, `IExpressionFactory`, `IEvaluationVisitorFactory`, and `Expression.EvaluateAsync` instead.
- Async DI customization methods were removed from `NCalcServiceBuilder`: use `WithExpressionFactory` and `WithEvaluationVisitorFactory` instead of `WithAsyncExpressionFactory` and `WithAsyncEvaluationVisitorFactory`.
- Function and parameter callback delegates and argument types now use unified types in `NCalc.Handlers`. `FunctionArgs`, `ParameterArgs`, `ExpressionFunctionData`, `ExpressionParameterData`, `AsyncFunctionArgs`, `AsyncParameterArgs`, `AsyncExpressionFunctionData`, and `AsyncExpressionParameterData` were replaced by `FunctionEventArgs`, `ParameterEventArgs`, `FunctionData`, and `ParameterData`.
- Function callback arguments no longer expose arrays of nested `Expression` or `AsyncExpression` instances. `FunctionData` exposes `LogicalExpression` arguments and provides `Evaluate(index)` / `EvaluateAsync(index)` helpers for evaluating them with the current `ExpressionContext`.
- `AsyncExpressionFunction` now returns `Task<object?>` and receives `FunctionData`. `AsyncExpressionParameter` was removed; dynamic parameters now use `ExpressionParameter`.
- `ExpressionBase<TExpressionContext>` and `ExpressionContextBase` were removed. Custom expression types should derive from or compose `Expression` and use `ExpressionContext`.
- `LogicalExpression.ToString()` no longer serializes the expression tree. Use `ToExpressionString()` from `NCalc.Extensions` when an expression string representation is required.
- Public `CancellationToken` parameter names were renamed from `ct` to `cancellationToken`. Calls that use named arguments must be updated.
- Evaluation failures may now be wrapped in `NCalcEvaluationException`; inspect `InnerException` for the original exception.
### [`v5.13.0`](https://github.com/ncalc/ncalc/blob/HEAD/CHANGELOG.md#5130)
- Arithmetic null or empty string as zero by [@​gumbarros](https://github.com/gumbarros) in [#​546](https://github.com/ncalc/ncalc/pull/546)
- Support for multiple argument separators in expression by [@​Bykiev](https://github.com/Bykiev) in [#​541](https://github.com/ncalc/ncalc/pull/541)
- Migrate unit tests to TUnit by [@​gumbarros](https://github.com/gumbarros) in [#​553](https://github.com/ncalc/ncalc/pull/553)
- Breaking change: Switch to `NullLoggerFactory` as default logger by [@​gumbarros](https://github.com/gumbarros) in [#​554](https://github.com/ncalc/ncalc/pull/554)
- Update packages by [@​Bykiev](https://github.com/Bykiev) in [#​556](https://github.com/ncalc/ncalc/pull/556)
- New docs layout by [@​gumbarros](https://github.com/gumbarros) in [#​555](https://github.com/ncalc/ncalc/pull/555)
- Added basic AOT functionality by [@​vpenades](https://github.com/vpenades) in [#​523](https://github.com/ncalc/ncalc/pull/523)
</details>
---
### Configuration
📅 **Schedule**: (UTC)
- Branch creation
- At any time (no schedule defined)
- Automerge
- At any time (no schedule defined)
🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMTQuNSIsInVwZGF0ZWRJblZlciI6IjQzLjI0My4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Codex status update 2026-06-11: not safe to merge.
Breaking change: NCalcSync v6 changes function callback argument evaluation APIs. CI confirms the migration is required: LogicalExpression no longer has the expected Evaluate calls in MeetingWorkflowEngine.
Affected: likely. The workflow rules engine uses custom contains, starts_with, and ends_with functions.
Risk: high. The PR does not compile as-is.
Recommendation: needs a migration. Update the workflow engine to the NCalc v6 API and add/adjust tests before merging.
Codex status update 2026-06-11: not safe to merge.
Breaking change: NCalcSync v6 changes function callback argument evaluation APIs. CI confirms the migration is required: `LogicalExpression` no longer has the expected `Evaluate` calls in `MeetingWorkflowEngine`.
Affected: likely. The workflow rules engine uses custom `contains`, `starts_with`, and `ends_with` functions.
Risk: high. The PR does not compile as-is.
Recommendation: needs a migration. Update the workflow engine to the NCalc v6 API and add/adjust tests before merging.
Codex automation status update 2026-06-18: still not safe for unattended merge.
Breaking change: NCalc v6 changes function callback/evaluation APIs; current CI fails with LogicalExpression no longer exposing Evaluate() in MeetingWorkflowEngine.
Affected: likely. Meeting workflow rules use NCalc custom functions and expression evaluation.
Risk: high for this PR because it currently does not compile.
Recommendation: needs a migration. Update MeetingWorkflowEngine to the v6 callback API, then merge only after PR CI is green.
Codex automation status update 2026-06-18: still not safe for unattended merge.
Breaking change: NCalc v6 changes function callback/evaluation APIs; current CI fails with `LogicalExpression` no longer exposing `Evaluate()` in `MeetingWorkflowEngine`.
Affected: likely. Meeting workflow rules use NCalc custom functions and expression evaluation.
Risk: high for this PR because it currently does not compile.
Recommendation: needs a migration. Update `MeetingWorkflowEngine` to the v6 callback API, then merge only after PR CI is green.
The PR was refreshed to NCalcSync 6.3.1, but no source migration was added. Current CI still fails to compile: MeetingWorkflowEngine.cs uses args[0].Evaluate() / args[1].Evaluate(), while NCalc v6 changed custom function callbacks to FunctionData.Evaluate(index) / EvaluateAsync(index). The failure is a source migration issue, not a transient test flake.
Affected likelihood: certain. Risk: hard build break.
Recommendation: needs a migration patch before merge. Update the custom function callback code, then rerun PR CI.
Status update: still blocked; do not merge.
The PR was refreshed to `NCalcSync` 6.3.1, but no source migration was added. Current CI still fails to compile: `MeetingWorkflowEngine.cs` uses `args[0].Evaluate()` / `args[1].Evaluate()`, while NCalc v6 changed custom function callbacks to `FunctionData.Evaluate(index)` / `EvaluateAsync(index)`. The failure is a source migration issue, not a transient test flake.
Affected likelihood: certain. Risk: hard build break.
Recommendation: needs a migration patch before merge. Update the custom function callback code, then rerun PR CI.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This PR contains the following updates:
5.12.0→6.3.2Release Notes
ncalc/ncalc (NCalcSync)
v6.3.2incomparisons by @gumbarros in #587v6.3.1LogicalExpressionListto implementIReadOnlyListinstead ofIListfor improved performance by @george-domingos in #585v6.3.0v6.2.0v6.1.1v6.1.0v6.0.0EvaluationVisitorremovingLazyto optimize binary expression handling. by @gumbarros in #561Expressionand better handle null parameter. by @gumbarros in #562NCalcEvaluationExceptionby @gumbarros in #565ExpressionContext.cs. by @gumbarros in #566ToExpressionStringandParameterSubstitutionVisitorby @gumbarros in #567CancellationTokenparameters from ct to cancellationToken to align with Microsoft naming conventions. by @gumbarros in #568Breaking Changes
NCalc.Domainnamespace and intoNCalc. For example, useNCalc.LogicalExpression,NCalc.BinaryExpression,NCalc.Function, andNCalc.ValueExpressioninstead ofNCalc.Domain.*.NCalc.Parserassembly. Projects that use parser APIs directly must referenceNCalc.ParserandNCalc.Domainin addition toNCalc.Corewhen those assemblies are not brought in transitively.ArgumentSeparatorwas renamed toLogicalExpressionArgumentSeparator.LogicalExpressionParserOptionsno longer exposesDefault,WithCultureInfo,WithArgumentSeparator,Create, or the implicitCultureInfoconversion; use object initialization or the new constructors instead.NCalc.Core.AsyncExpression,AsyncExpressionContext,IAsyncExpressionFactory,AsyncExpressionFactory,IAsyncEvaluationVisitorFactory,AsyncEvaluationVisitorFactory, andAsyncEvaluationVisitorwere removed; useExpression,ExpressionContext,IExpressionFactory,IEvaluationVisitorFactory, andExpression.EvaluateAsyncinstead.NCalcServiceBuilder: useWithExpressionFactoryandWithEvaluationVisitorFactoryinstead ofWithAsyncExpressionFactoryandWithAsyncEvaluationVisitorFactory.NCalc.Handlers.FunctionArgs,ParameterArgs,ExpressionFunctionData,ExpressionParameterData,AsyncFunctionArgs,AsyncParameterArgs,AsyncExpressionFunctionData, andAsyncExpressionParameterDatawere replaced byFunctionEventArgs,ParameterEventArgs,FunctionData, andParameterData.ExpressionorAsyncExpressioninstances.FunctionDataexposesLogicalExpressionarguments and providesEvaluate(index)/EvaluateAsync(index)helpers for evaluating them with the currentExpressionContext.AsyncExpressionFunctionnow returnsTask<object?>and receivesFunctionData.AsyncExpressionParameterwas removed; dynamic parameters now useExpressionParameter.ExpressionBase<TExpressionContext>andExpressionContextBasewere removed. Custom expression types should derive from or composeExpressionand useExpressionContext.LogicalExpression.ToString()no longer serializes the expression tree. UseToExpressionString()fromNCalc.Extensionswhen an expression string representation is required.CancellationTokenparameter names were renamed fromcttocancellationToken. Calls that use named arguments must be updated.NCalcEvaluationException; inspectInnerExceptionfor the original exception.v5.13.0NullLoggerFactoryas default logger by @gumbarros in #554Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate.
Codex status update 2026-06-11: not safe to merge.
Breaking change: NCalcSync v6 changes function callback argument evaluation APIs. CI confirms the migration is required:
LogicalExpressionno longer has the expectedEvaluatecalls inMeetingWorkflowEngine.Affected: likely. The workflow rules engine uses custom
contains,starts_with, andends_withfunctions.Risk: high. The PR does not compile as-is.
Recommendation: needs a migration. Update the workflow engine to the NCalc v6 API and add/adjust tests before merging.
4b70432c38to59a0de9e0f59a0de9e0fto4e79b84af8Codex automation status update 2026-06-18: still not safe for unattended merge.
Breaking change: NCalc v6 changes function callback/evaluation APIs; current CI fails with
LogicalExpressionno longer exposingEvaluate()inMeetingWorkflowEngine.Affected: likely. Meeting workflow rules use NCalc custom functions and expression evaluation.
Risk: high for this PR because it currently does not compile.
Recommendation: needs a migration. Update
MeetingWorkflowEngineto the v6 callback API, then merge only after PR CI is green.4e79b84af8to576cb755c7576cb755c7toc4b4d25779Status update: still blocked; do not merge.
The PR was refreshed to
NCalcSync6.3.1, but no source migration was added. Current CI still fails to compile:MeetingWorkflowEngine.csusesargs[0].Evaluate()/args[1].Evaluate(), while NCalc v6 changed custom function callbacks toFunctionData.Evaluate(index)/EvaluateAsync(index). The failure is a source migration issue, not a transient test flake.Affected likelihood: certain. Risk: hard build break.
Recommendation: needs a migration patch before merge. Update the custom function callback code, then rerun PR CI.
c4b4d25779to2af3b5bf83Update dependency NCalcSync to v6to Update dependency NCalcSync to v6 - autoclosedPull request closed