Home > Net >  A question about lambda expressions
A question about lambda expressions

Time:10-09

 g.S um (item=& gt; Item. Is_done? 1-0) 

Lambda expressions, and need to do a group summary, but Is_done bool, how to use the ternary operator, consult everybody

CodePudding user response:

Above the code error directly

CodePudding user response:

Not checked twice?

The number and the number of false Is_done to true

CodePudding user response:

It won't error, if is your Is_done bool type,

CodePudding user response:

Right to mount (item=& gt; Item. Is_done)
Don't you is to be the number of true results

CodePudding user response:

This have to ask you is what, such as EF, he can't explain, for example the list he can explain

Are linq IQueryable but points, IEnumerable

Dojo.provide is IQueryable but points


So, there is no preface, and I have no language, after this problem didn't show the premise, we are unable to answer

CodePudding user response:

Try this two
G.S um (item=& gt; The Convert. ToInt32 (item. Is_done));
Right to mount (item=& gt; Item. Is_done==true);

CodePudding user response:

G.S well (item=& gt; Item. Is_done? 1-0). The Sum ()
Or
Right to mount (x=& gt; X.I sDone)

CodePudding user response:

G.S well (item=& gt; Item. Is_done? 1-0). The Sum ()
Or
Right to mount (x=& gt; X.I sDone)

I collect the
  •  Tags:  
  • C#
  • Related