Join Olivia Chiu Stone for an in-depth discussion in this video Tree queries, part of LINQ with C# Essential Training.
- Linq to Xml extends Linq's functionality…to query data from an Xml file.…The syntax to do this, is similar to any other Linq query.…First, I'll create a query variable.…Then, I'll specify the data source,…which is an Xml file, using the from clause.…Instead of referencing a sequence of objects…that I've created in my program,…I'll use an Xml file for my sequence.…XDocument.Load is used to specify…the Xml file I want loaded and referenced in my program.…
In this case, Customers.xml.…By default, load will look in the bin debug folder…that is located in the same place…as my solutions files for the Xml file.…Descendants is then used to retrieve the elements…that are under each of the customer elements…in the Xml file.…Next, I will add a where clause…to filter for customers in Oregon.…The element State.value is used within my word query…to return the value of the State element in the Xml file.…
It will be compared with OR to determine whether…it should be included in the final sequence.…I finally used select to return the first name…
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.