Read an XML file and store as an object

Flitmetebob

New Member
I am new to C#, MVC4, ASP.NET, Entity Framework.I have an XML file which I want to convert to a c# object.How do I do this?To give an idea of what I would like to do with the XML file:I wish to display certain parts of the xml file within a table in a view.I wish to be able to select parts of the data and send to a database.At present, I have...\[code\] public ViewResult Index() { string url = "......"; var xml = XDocument.Load(url); return View(xml); }\[/code\]My view model is: @model IEnumerableBut I get an error on run saying: \[quote\] The model item passed into the dictionary is of type 'System.Xml.Linq.XElement', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1[System.Xml.Linq.XElement]'. \[/quote\]
 
Back
Top