equals versus ==

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

No related posts.

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

Read previous post:
Rich Internet Application And Content Management

Today everyone talks about Web 2.0. But while the idea of a collective intelligence, implied here by the term's inventor...

Close