Help Understanding Enumerable.Join Method

Posted by lush on Stack Overflow See other posts from Stack Overflow or by lush
Published on 2010-03-13T19:03:35Z Indexed on 2010/03/13 19:15 UTC
Read the original article Hit count: 1068

Filed under:
|

Yesterday I posted this question regarding using lambdas inside of a Join() method to check if 2 conditions exist across 2 entities. I received an answer on the question, which worked perfectly. I thought after reading the MSDN article on the Enumerable.Join() method, I'd understand exactly what was happening, but I don't. Could someone help me understand what's going on in the below code (the Join() method specifically)? Thanks in advance.

if (db.TableA.Where( a => a.UserID == currentUser )
      .Join( db.TableB.Where( b => b.MyField == someValue ),
             o => o.someFieldID,
             i => i.someFieldID,
             (o,i) => o )
      .Any()) 
{
    //...
}

© Stack Overflow or respective owner

Related posts about c#

Related posts about LINQ