score:2
Accepted answer
y.descendants("option").select(z => new option
{
name = (string)z.attribute("name"),
value = (string)z.attribute("value")
}
score:0
using (var reader = new stringreader(xml))
{
var xmlserializer = new xmlserializer(typeof(preferencesmodel));
var data = xmlserializer.deserialize(reader);
}
Source: stackoverflow.com
Related Query
- How to select nested xml nodes into Model
- Parsing SOAP response with LINQ to XML - how to get nested nodes under parent?
- How do I read all XML nodes of a specific name and put them into an array (or list)?
- How to select child nodes when parent node equals a specific value in LINQ to XML
- How do I select XML elements into a strongly-typed collection using LINQ?
- How to select XML nodes by position (Linq or XPATH)
- How to count nodes in XML that have been read into a string
- how to load nested XML into LINQ
- How do I convert a nested SQL select statement with multiple aggregate functions into LINQ?
- How to use LINQ to select into an object?
- How do I insert an element into XML using Linq?
- How to parse XML data into the properties of a custom C# class?
- how to add/insert conditional node into XML using linq to XML
- LINQ Query - How to map a resultset into another object using Select
- How can I use LINQ to project this parent and children object model into a flat, single object?
- How to Select by LINQ into anonymous type in F#
- Select nodes Linq to Xml C#
- How to write this nested Linq To Xml query
- How to make a SUM of Dictionary Value nested into a list with LINQ?
- linq select sum and average into view model
- How can i select all values from a nested dictionary with linq?
- How to select multiple columns from dataset into a string list with LinQ
- How to group then select elements into new class in LINQ (C# preferably)
- How is this Nested Set SQL query converted into a LINQ query?
- How can I load the following XML using LINQ-to-XML into a dictionary?
- How to Select Multiple XML tags as XElement By attatribute value?
- How to parse XML header and nested sections using LINQ
- Select descendent nodes and elements from an XML using LINQ
- How to implement nested for loop into Linq?
- Using LINQ, how do I load a hierarchical XML into a POCO?
More Query from same tag
- How can I perform a nested Join, Add, and Group in LINQ?
- Conditional predicates in LINQ?
- How to convert date to string and compare using Linq
- Predicate Expression as Filter Parameter
- Linq, Expressions, NHibernate and Like comparison
- Parse Nested XML Attributes with Linq
- best way to compare differences between lists
- How to retrieve data with LINQ to SQL into a weakly-typed object that can be moved around
- SQL Server Database is not updated via C# Code
- Linq List to Byte Array
- Order by not working in LINQ query
- A dictionary where value is an anonymous type in C#
- LINQ Query Syntax: Group By and OrderBy and take one row
- EF eagerly load filtered child objects / filter only childs
- Entity Framework object limitations in aggregate LINQ query
- ERROR Static method requires null instance, non-static method requires non-null instance
- Second "from" statement in LINQ
- Get items from list where index not equal to an int using LINQ
- Linq To Entities 'Only primitive types or enumeration types are supported' Error
- How to debug a LINQ Statement
- Add up values from two datatables into a new datatable
- Combine and sort 2 tables
- How to query using a string in LINQ
- How to do "nested" eager loading in Entity Framework?
- Best way to find values not in two lists c#
- Method using LINQ in my Repository that gets null errors
- MVC Linq for multiple selects that allow multiple selections
- Filter PropertyInfo by attribute enum value
- Get n (part of) objects from a list of objects, starting from n index
- How to build List by using data from another List using LINQ