Interesting subject which Daniel Moth explains:
At a recent event where I was presenting on LINQ, I showed a query with a join, similar to the following:
var results = from p in Process.GetProcesses() join p2 in MyProccess.GetMyProcList() on p.ProcessName equals p2.MyProcName where p.Threads.Count > 14 orderby p.ProcessName descending select new { p2.MyProcDescription, ThreadCount = p.Threads.Count, p.Id };
After the session one of the delegates asked me: “Why do we have to use the equals keyword and not just ==“. In other words he would have preferred to type:
on p.ProcessName == p2.MyProcName
I didn’t have a good answer but promised to look into it.
view original