, .
InvTotal, var InvTotal =...., .
:
# - :
int x = 2;
var tmp = x ? "W" : "N";
, :
: " " int "" bool ""
# ++, false, true.
So you can write something like this:
g.Sum(d => d.Field<double>("Total")) < 0 ? "W" : "N"
you can also have several logical operators without parentheses in the first section of the triple operator:
g.Sum(d => d.Field<double>("Total")) < 0 && 1 == 1 && 2 != 4 && 9 != 0 ? "W" : "N";
source
share