I have a message table in which there is an identifier of the user who sent it on each line. But I can not edit the database, and there are no foreign keys. Can I join without any relationship?
var msgs = (from m in dbContext.messages join a in dbContext.users on m.userid equals a.id into sender where (m.date > LastReceivedDate) orderby m.date select new { Sender = sender.FirstOrDefault(), Message = m })
Here is my code and it works, but never returns anything. When I participate, I get results.
thanks
source share