首页 新闻 赞助 找找看

关于EF的函数问题

0
悬赏园豆:10 [已解决问题] 解决于 2021-03-09 23:41

请问下图的函数格式怎么写,像Express<Func<Category,bool>>predicate的写法是(x=>x.ID>10),下图多了一个参数就不懂怎么写了,请大佬帮帮忙

godcloudy的主页 godcloudy | 初学一级 | 园豆:18
提问于:2021-02-27 16:49
< >
分享
最佳答案
0

public delegate TResult Func<in T1,in T2,out TResult>(T1 arg1, T2 arg2);

Type Parameters

T1

The type of the first parameter of the method that this delegate encapsulates.

This type parameter is contravariant. That is, you can use either the type you specified or any type that is less derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics.
T2

The type of the second parameter of the method that this delegate encapsulates.

This type parameter is contravariant. That is, you can use either the type you specified or any type that is less derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics.
TResult

The type of the return value of the method that this delegate encapsulates.

This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics.
 
SO:(t0,t1)=>true;
收获园豆:10
花飘水流兮 | 专家六级 |园豆:13560 | 2021-02-27 18:28

报错了,不识别x,请问这是什么情况

godcloudy | 园豆:18 (初学一级) | 2021-02-27 18:49
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册