什么是Linq中的Take()方法 [英] What is Take() method in Linq

查看:55
本文介绍了什么是Linq中的Take()方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在下面的代码中Take()方法的功能是什么?

In the folloeing codes What is the function of Take() method?

IEnumerable<employee> emp =
         dc.Employees.Where(x => x.Desc.StartsWith("soft"));
emp = emp.Take(1);

推荐答案

[ ^ ]从序列的开头返回指定数量的连续元素。
Take[^] returns a specified number of contiguous elements from the start of a sequence.


这篇关于什么是Linq中的Take()方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆