可学答题网 > 问答 > MCTS(70-515)题库
目录: 标题| 题干| 答案| 搜索| 相关
问题

You are implementing a


You are implementing an ASP.NET application. You add the following code segment. You need to add code to return a list of all Person objects except those with a UserId that is contained in the secretUsers list. The resulting list must not contain duplicates. Which code segment should you use?()

  • Avar secretPeople = (from p in allPeople from u in secretUsers  where p.UserId == u select p).Distinct(); return allPeople.Except(secretPeople);
  • Breturn from p in allPeople from u in secretUsers where p.UserId != u select p;
  • Creturn (from p in allPeople  from u in secretUsers where p.UserId != u select p).Distinct();
  • DList people = new List( from p in allPeople from u in secretUsers where p.UserId != u select p); return people.Distinct();
参考答案
参考解析:
分类:MCTS(70-515)题库