You are writing this:
from a in context.People
from b in context.People
where a.BirthDate.Subtract(b.BirthDate).TotalDays < 1
select new { a, b };
You receive the error:
Method 'System.TimeSpan Subtract(System.DateTime)' has no supported translation to SQL.
You should be writing this:
from a in context.People
from b in context.People
where (a.BirthDate - b.BirthDate).TotalDays < 1
select new { a, b };
Legend, thanks!
ReplyDeleteThanks! Straight to the point :)
ReplyDelete