为您的ClassA添加更新方法
class ClassA { public ClassA UpdateWithB(ClassB objectB) { // Do the update return this; } }
然后用
return from objectA in GetObjectAs() join objectB in GetObjectBs() on objectA.Id equals objectB.AId // update object A with object B data before selecting it select objectA.UpdateWithB(objectB);
编辑:
或使用本地lambda函数,如:
Funcf = ((a,b)=> { a.DoSomethingWithB(b); return a;}); return from objectA in GetObjectAs() join objectB in GetObjectBs() on objectA.Id equals objectB.AId select f(objectA , objectA );