I have a simple type that explicitly implemets an Interface.
public interface IMessageHeader
{
string FromAddress { get; set; }
string ToAddress { get; set; }
}
[Serializable]
public class MessageHeader:IMessageHeader
{
private string from;
private string to;
[XmlAttribute("From")]
string IMessageHeade.FromAddress
{
get { return this.from;}
set { this.from = value;}
}
[XmlAttribute("To")]
string IMessageHeade.ToAddress
{
get { return this.to;}
set { this.to = value;}
}
}
Is there a way to Serialize and Deserialize objects of type IMessageHeader??
I got the following error when tried
"Cannot serialize interface IMessageHeader"