Help Understanding Enumerable.Join Method

前端 未结 4 687
时光取名叫无心
时光取名叫无心 2021-02-04 11:45

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

4条回答
  •  既然无缘
    2021-02-04 12:19

    Explanation of the Join.

    b = object type of first table o = object type of first table i = object type of second table

    1. db.TableB.Where( b => b.MyField == someValue ) This is the element type of the second table
    2. o => o.someFieldID The key of the first table
    3. i => i.someFieldID The key of the second table (which will match the key in the first table)
    4. (o,i) => o The object to return, in this case the object type of the first table.

提交回复
热议问题