Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Few improvements to suggest. #402

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add Contains Key
ianido committed Oct 12, 2022
commit e842e94e8d86f00db0e29a35acb8700561c3f382
5 changes: 5 additions & 0 deletions src/RulesEngine/Actions/ActionContext.cs
Original file line number Diff line number Diff line change
@@ -41,6 +41,11 @@ public RuleResultTree GetParentRuleResult()
return _parentResult;
}

public bool ContainsKey(string name)
{
return _context.ContainsKey(name);
}

public bool TryGetContext<T>(string name,out T output)
{
try
8 changes: 0 additions & 8 deletions src/RulesEngine/Actions/EvaluateRuleAction.cs
Original file line number Diff line number Diff line change
@@ -27,14 +27,6 @@ internal async override ValueTask<ActionRuleResult> ExecuteAndReturnResultAsync(
var output = innerResult.Output as ActionRuleResult;
List<RuleResultTree> resultList = null;

if (innerResult.Exception != null)
{
foreach(var result in innerResult.Results)
{
result.ExceptionMessage += innerResult.Exception.Message;
}
}

if (includeRuleResults || output?.Results?.Count > 0)
{
resultList = new List<RuleResultTree>(output?.Results ?? new List<RuleResultTree>() { });