2

我想看看有多少已经全额支付,全额支付有点,但是 Visual Studio 和 Linq 将其转换为布尔值?

除非我强制转换,否则下面的代码将不起作用,但我该如何转换呢?我尝试了多种方法。

int i = (from c in YSA.YSAs
                where c.YSA_PAID_FULL = true
                select c).Count();
4

2 回答 2

2

==不需要=

int i = (from c in YSA.YSAs
         where c.YSA_PAID_FULL == true
         select c).Count();
于 2013-03-20T06:54:20.267 回答
1

看起来你应该使用==运算符

where c.YSA_PAID_FULL == true

喜欢;

int i = (from c in YSA.YSAs
                where c.YSA_PAID_FULL == true
                select c).Count();
于 2013-03-20T06:55:18.837 回答