如何使用linq连接查询结果调用函数? [英] how to call a function with a linq join query result?

查看:61
本文介绍了如何使用linq连接查询结果调用函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

context bd = new context();



var c = bd.table1.join(table2,i => i.key1,j => j.key1,(i,j)=> new {ia,ib,ic,jx,jy,jz});

fx1(c);

< br $>




public void fx1(?????)

{

.......

......

}





什么是参数类型???

context bd=new context();

var c= bd.table1.join(table2,i=>i.key1,j=>j.key1,(i,j)=>new{i.a ,i.b ,i.c ,j.x ,j.y , j.z});
fx1(c);



public void fx1(?????)
{
.......
......
}


what would be the parameter type???

推荐答案

你可以将lambda表达式传递给函数。





public void fx(表达式< func>< tinputclasstype,>>表达式)

{

。 ........

............

}



让函数运行LINQ
You can pass the lambda expression to the function.


public void fx(Expression<func><tinputclasstype,>> expression)
{
.........
............
}

let the function run the LINQ


这篇关于如何使用linq连接查询结果调用函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆