Reputation: 148524
I have a list of list of Policies
.
I Also have a external datatable which has a DecisionId
column ( among other columns as well).
I need to find all policies which their IsUWDecsionApproved
prop is false
and
The policy property which is called DecisionId
should not exists in the datatable. ( at the DecisionId
column).
here is my try :
var t = _chached.SelectMany(f => f.LST_Policy)
.Where(fd =>!fd.IsUWDecsionApproved &&
!(dt.AsEnumerable() .Select(b => b["DecisionId"].ToString()))
.Contains(fd => fd.UWdecisionID)
);
Here is the error : https://i.sstatic.net/Y1QNE.png
Sql wording :
select policy from _cached where !policy.IsUWDecsionApproved && policy.DecisionIdId not in
( select DecisionIdId from datatable)
How can I fix that ? ( no temp Ienumerables please)
Visual :
I need that second fd
will be the same as the first fd
:
https://i.sstatic.net/syMgY.png
Upvotes: 0
Views: 152
Reputation: 1318
Change ->
ie Contains(fd.UWdecisionID).
The error here was you defined fd in the where clause delegate parameter and tried to reuse the same name in the Contains clause which comes inside the Where clause.
That is why the compiler complained.
Upvotes: 2