Question

I have a class (call it pubs) with some members defined as follows

public string Publisher { get { return PUBLISHER; } }
public string PublisherUrl { get { return PUBLISHER_URL; } }
public DateTime LastBuildDate { get; set; }

Now, an object of this class is serialized and returned as a XMLResult.However, the Publisher and PublisherUrl properties are not part of the XML.

This is being done in the method of my controller which returns an XMLResult (I am using MvcContrib) as follows

return XMlResult(pubs)

Why would the Publisher and PublisherUrl properties not appear in XML?

Était-ce utile?

La solution

XmlSerializer handles only public properties that have both - a public getter and a public setter

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top