From the course: Complete Guide to .NET LINQ: Querying Collections, Databases, and Markup

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Use Where to compare values

Use Where to compare values

- [Instructor] In this example, we're continuing to explore how to use the where clause in a link query. This time filtering based on a value of an XML element rather than an attribute. The structure of the query is similar to what we've seen before. We're starting by selecting all the cards, and then I'm drilling down to get the BidPrice element, so this'll be the element that I want for my source. Then here I am going to define another variable called bidParsed that is a decimal value. So I'm taking the string value and converting it to a decimal. Then I can use this code right here where bidParsed is greater than 12.00. So this is numeric and this is numeric. Now here when I select out my type, I'm selecting out the card name and then the BidPrice. And you can see here, this is a string and this is a decimal. Now, what I'm going to do in the next example is create a calculated column based on the BidPrice and the CatalogPrice. So we have the catalog, which is the original price of…

Contents