如何在Linq lambda表达式中“选择新”?

时间:2020-11-28 19:06:21

How do i do this in one statement vs breaking up in two?

我如何在一个声明中与两个分手?

 var newpeople= _rep.GetPeople().Where(p=>p.personID).Select(new KindoFPerson...id=p.id etc)

1 个解决方案

#1


var newpeople= _rep.GetPeople().Where(p=>p.personID)
    .Select(p => new KindoFPerson...id=p.id etc)

Note the new "p =>".

注意新的“p =>”。

#1


var newpeople= _rep.GetPeople().Where(p=>p.personID)
    .Select(p => new KindoFPerson...id=p.id etc)

Note the new "p =>".

注意新的“p =>”。