我的课程名为ID及其'塞特是私人的。我无法理解DataContractSerializer如何能够正确地反序列化流,因为setter是私有的?
[DataContract(IsReference = true)]
[KnownType(typeof(FormElementBase))]
[KnownType(typeof(FormDataElementBase))]
[KnownType(typeof(FormElementGroupBase))]
[KnownType(typeof(BoxGroup))]
[KnownType(typeof(PanelGroup))]
[KnownType(typeof(PageGroup))]
[KnownType(typeof(PageGroupContainer))]
public abstract class ApplicationDomainItemBase
{
protected ApplicationDomainItemBase()
{
}
protected ApplicationDomainItemBase(int id) : this(id, "", "")
{
}
protected ApplicationDomainItemBase(int id, string name, string description)
{
_ID = id;
_Name = name;
_Description = description;
}
[DataMember]
private int _ID;
[DataMember]
public int ID
{
get { return _ID; }
private set
{ }
}
}
感谢您的帮助。