Join Olivia Chiu Stone for an in-depth discussion in this video Take and skip operators, part of LINQ with C# Essential Training.
- With the lambda syntax,…I want to access some more functionality…that I was not able to use with comprehension syntax,…to take and skip items within a sequence.…I had used this to filter out all unique products…that customers are buying.…From this list, I want to take a few products…to feature on my website as popular products.…Unfortunately, I can only display…three products at a time.…The Take and Skip operators can be used…to help me with that.…Take returns a number of elements in a sequence,…so if your sequence was 1 through 10,…and n was 3, the returned sequence would be 1-3.…
Skip returns all the elements except…for a specified number of elements…from the beginning of the sequence.…Using the same sequence of 1-10, if n was 3,…the return sequence would be 4-10.…This can be useful if you want…a specific chunk of a sequence,…such as returning the middle chunk…of a search on a website.…I'll create another query to take the results…from the previous distinct query.…I'll take the first three items,…and create the foreach statement to use this query,…
AuthorOlivia Chiu Stone
In LINQ with C# Essential Training, engineer Olivia Chiu introduces techniques for querying, updating, and transforming data with LINQ. She covers standard queries—such as finding overlaps in two datasets and creating hierarchies—as well as complex chained queries. She also shows how to group and join LINQ queries with lambda expressions, and use LINQ to query SQL databases and XML documents. Last but not least, Olivia provides tips for optimizing the performance of your queries.
- Creating and executing a LINQ query
- Returning results
- Changing the data source type
- Performing standard queries
- Working with lambda expressions
- Chaining and complex queries
- Querying SQL and XML
- Performing tree queries
- Using sequences, elements, and scalars
- Allocating memory
Skill Level Intermediate
1. Introduction to LINQ
Common use cases1m 45s
2. Basic LINQ Queries
3. Data Transformation
Return results as a new type1m 39s
4. Type Relationships
5. Standard Queries
6. Lambda Expressions
7. Complex Queries
8. LINQ to SQL
9. LINQ to XML
10. Other Operators
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.