Join Olivia Chiu Stone for an in-depth discussion in this video Return results as a new type, part of LINQ with C# Essential Training.
- There are times when you'll want to transform…and modify the resulting sequence of a query.…Sometimes you only need a piece of a larger data set return.…The link library is a good tool to help with that.…One common transformation is to take a specific property…or a subset of properties from the original elements…and create a new sequence with them.…In this program, I have my list of customers,…with their contact information,…the purchases they've made, and other customer information.…If I wanted just a customer name…and the products they've bought,…I can use a query to create that new list.…
I'll call my new query custPurQuery.…I will introduce my source sequence using from.…From my source customer element,…I will grab their purchases,…and select to return the customer name and purchases.…To execute the query, I will add before each statement…when the query custPurQuery is called,…using the for each statement,…it will iterate through the customer list…using cust as iteration variable.…
For each customer element,…
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.