microsoft / microsoft/RulesEngine

no applicable aggregate method 'include(Child)' exists"

Open
#542 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

needs investigation
Dominant language
C#
Stars
4.4k
Forks
616
Avg merge
6m
Merged PRs (30d)
2

Description

Hello,

I have been using this library and got stuck with this issue.
When querying a database table using EFCore,
DbSet.Include does not seem to work

Below is sample entity/table structure
Entity Parent
{
string id
string name
Entity child
}

Entity Child
{
string id
string parentId
string role
}

parentDbSet = "DbSet"

Expression: "parentDbSet.Include(i=>i.Child)"

Fails with the error
no applicable aggregate method 'include(Child)' exists"

Can please let know, if the rule engine does support EntityFrameworkQueryableExtensions methods

PS: I tried to pass the Child Entity and EntityFrameworkQueryableExtensions as RESettings, no luck either

var reSettingsWithCustomTypes = new ReSettings { CustomTypes = new Type[] { typeof(Child), typeof(EntityFrameworkQueryableExtensions) } };
var rulesEngine = new RulesEngine.RulesEngine(workflow.ToArray(), reSettingsWithCustomTypes);

var rp1 = new RuleParameter("parentDbSet", parentDbSet);
List response = await rulesEngine.ExecuteAllRulesAsync("workflow", rp1);

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported parentDbSet.Include(i=>i.Child) expression with the provided Parent and Child structure, then inspect how EntityFrameworkQueryableExtensions methods are resolved. Done should mean determining whether Include is supported by the rule engine and either making this expression work or clearly documenting the limitation and required configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.