I have a peculiar problem with LINQ to SQL:
Doing this is fine:
from s in Something
join a in AnotherThing
on s.NullableDateTime.Value
equals a.DateTime
select s
However, using anonymous type like so:
from s in Something
join a in AnotherThing
on new { s.NullableDateTime.Value }
equals new { a.DateTime }
select s
Results in
The type of one of the expressions in the join clause is incorrect. Type inference failed in the call to 'Join'.
I need to use anonymous types as I aim to add another column to join on.
Any ideas as to why this is occurring and how to fix?