Lost values with XML Deserializion
- by iTayb
Here is my class BookStore: http://pastebin.com/dnQkDUWk
The class can be load and save XML files.
For some reason, I have a problem regarding Rating value that gets lost when I load from XML (using void LoadFromXML(string path) method.
The following code prints 0 although actual value is 5:
BookStore b = new BookStore();
b.LoadFromXML(Server.MapPath("list.xml"));
Label1.Text = b.BooksList[0].Rating.ToString();
Please note: only the specific Rating parameter is lost. I can't figure what went wrong.
Thank you very much!