I have a join clause with multiple conditions, one being a static value, however I’m receiving “Invalid anonymous type member declerator” when compiling.
join t7 in db.Notes.DefaultIfEmpty() on new { t2.Lead_ID } equals new { t7.Item_ID, 5 = t7.Type_ID } into notes
For clarity, I’m joining:
- t2.Lead_ID to t7.Item_ID
- t7.Type_ID to 5 (or a variable)
Could anybody point me in the right direction?
You are doing this wrong. From you code it seems, you try to join on object that have one prop on one side and object with 2 props on the other (and 5= t7.Item_ID) is an error itself.
You should try writing it like this:
This should give you result you want.