LINQ In Line Property Update During Join

后端 未结 6 1417
难免孤独
难免孤独 2021-02-05 11:55

I have two obects, A & B for this discussion. I can join these objects (tables) via a common relationship or foreign key. I am using linq to do this join and I only want t

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-05 12:10

    can u try the let statement? (not at my dev machine to test this out myself):

    return from objectA in GetObjectAs()   
    join objectB in GetObjectBs()
    on objectA.Id equals objectB.AId
    let objectA.SomeProperty = objectB.AValueIWantBadly
    select objectA;
    

提交回复
热议问题