ASP.NET MVC 2: Deserialize SPROC Response

Posted by dcolumbus on Stack Overflow See other posts from Stack Overflow or by dcolumbus
Published on 2011-01-05T04:29:50Z Indexed on 2011/01/05 4:53 UTC
Read the original article Hit count: 269

I need to ask a general question. I don't have the code in front of me because I'm writing this on my iPhone.

I have a Class that represents a certain XML schema. I have a SPROC that returns this XML. What I need to do is deserialize the XML to this Class.

XML:

<xml>
     <person>
             <firstName>Bob</firstName>
             <lastName>Robby</lastName>
     </person>
</xml>

I need to deserialize this XML into the custom Person Class so I can loop through this Model and spit it out in the View. I'm sure there's some kind of casting involved, I just don't know how to do it.

© Stack Overflow or respective owner

Related posts about c#

Related posts about asp.net-mvc-2