หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
Element operations return a single, specific element from a sequence.
The standard query operator methods that perform element operations are listed in the following section.
Methods
| Method Name | Description | Visual Basic Query Expression Syntax | More Information |
|---|---|---|---|
| ElementAt | Returns the element at a specified index in a collection. | Not applicable. | Enumerable.ElementAt Queryable.ElementAt |
| ElementAtOrDefault | Returns the element at a specified index in a collection or a default value if the index is out of range. | Not applicable. | Enumerable.ElementAtOrDefault Queryable.ElementAtOrDefault |
| First | Returns the first element of a collection, or the first element that satisfies a condition. | Not applicable. | Enumerable.First Queryable.First |
| FirstOrDefault | Returns the first element of a collection, or the first element that satisfies a condition. Returns a default value if no such element exists. | Not applicable. | Enumerable.FirstOrDefault Queryable.FirstOrDefault Queryable.FirstOrDefault<TSource>(IQueryable<TSource>) |
| Last | Returns the last element of a collection, or the last element that satisfies a condition. | Not applicable. | Enumerable.Last Queryable.Last |
| LastOrDefault | Returns the last element of a collection, or the last element that satisfies a condition. Returns a default value if no such element exists. | Not applicable. | Enumerable.LastOrDefault Queryable.LastOrDefault |
| Single | Returns the only element of a collection, or the only element that satisfies a condition. | Not applicable. | Enumerable.Single Queryable.Single |
| SingleOrDefault | Returns the only element of a collection, or the only element that satisfies a condition. Returns a default value if no such element exists or the collection does not contain exactly one element. | Not applicable. | Enumerable.SingleOrDefault Queryable.SingleOrDefault |
See also
ทํางานร่วมกับเราใน GitHub
แหล่งที่มาสำหรับเนื้อหานี้สามารถพบได้บน GitHub ซึ่งคุณยังสามารถสร้างและตรวจสอบปัญหาและคำขอดึงข้อมูลได้ สำหรับข้อมูลเพิ่มเติม ให้ดูคู่มือผู้สนับสนุนของเรา