可学答题网 > 问答 > 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)题库
相关推荐

1、You are implementing a

You are implementing an ASP.NET Web site that uses a custom server control named Task. Tas...

2、You are implementing a

You are implementing a very simple TCP/IP network. It rarely changes and you would like to...

3、You are implementing a

You are implementing an ASP.NET MVC 2 Web application that contains several folders. The Views/...

4、You are implementing a

You are implementing an ASP.NET application that will use session state in out-of-proc mode. Yo...

5、You are implementing a

You are implementing an ASP.NET Web site. The site allows users to explicitly choose the d...

6、You are implementing a

You are implementing an ASP.NET application that uses LINQ to Entities to access and update&ens...