linq to sql -将可查询的值作为输入参数传递给LinqToSql中的用户定义函数


Var rettable=(from table1 in dao.table1s
    where table1.name="Question" Select table);

现在我需要将这个可查询的值传递给表值用户定义函数,并根据输出实现排序。

Var rettable2=(from rettab in rettable
join x in dao.userdefinedfunction (rettable.col1)
on x.col1=rettable.col1 and x.col2=='S'
select new {x,rettable} order by x.col1

我们如何实现这种功能?

不能传递给方法Iqueryable,但可以将其作为列表传递

var rettable=(from table1 in dao.table1s
where table1.name="Question" Select table).ToList();

和ret可传递给任何方法。

注:数组或列表也可以

最新更新