I have a linq database function which worked fine, however changes had to be made to the types holding certain bits of infomation outside of my control.
The currect situation is I have an asp.net 3.5 site, with infomation stored in a dictionary.
the code I have was
Table.Insert(_rules.RuleList
.Where(rule => !ruleRecords
.Any(r => r.RuleID == rule.RuleID)
));
As you can see it excludes where r.RuleID == rule.RuleID
All good, however ‘r’ is no longer an object, and is now a dictionary.
Any Ideas how I can get the value of the dictionary, by providing the key (“RuleID”) inside the linq query?
Any suggestions greatly appreciated, however I can not update to 4.0 and I cant have the data not stored in an object, unless it can be a temporary conversion
As long as the key of your dictionary is
RuleId, I think you can re-write this as: