c# - Parent-Child Filter with QueryBuilder -
suppose have 3 table: table employee, employmenthistory, , languages. 1 employee can have many language , employment history.
employee
id name email 1 aaa aaa@gmail.com 2 bbb bbb@gmail.com 3 ccc ccc@gmail.com
employment history
id employeeid company position 1 1 devon energy aaa 2 2 emric bbb 3 3 capcom ccc
language
id employeeid language level 1 1 english expert 2 2 dutch expert 3 3 franch expert
how apply filter using objectquery querybuilder ? example: want filter employee devon company. should employee "aaa".
var emp = translate(context.employees.include("employmenthistories")); public objectquery<t> translate<t>(objectquery<t> objectquery) { objectquery.where("it.employmenthistories.company = 'devon energy'"); // employmenthistories.company not found. how can filter through included property }
note: i'm using querybuilder advanced filtering.
best regards,
brian
after 1 day of excruciating pain, i've found solution. used dynamic linq provided microsoft dynamic linq solve problem
Comments
Post a Comment