I have the following serialization method shown below. The problem is that I am attempting to pass a class to it that contains a property of type Binary. The serialization is failing because of this property type. Is there any way I can serialize a class with a property of type Binary?
private string Serialize<TEntity>(TEntity instance)
{
string retStr = "";
XmlSerializer xs = new XmlSerializer(typeof(TEntity));
System.IO.StringWriter writer = new System.IO.StringWriter();
xs.Serialize(writer, instance);
retStr = writer.ToString();
writer.Close();
return retStr;
}
Here is the portion of the class that represents the Binary property.
/// <summary>
/// Row version number
/// </summary>
[DataMember(Order = 5)]
public System.Data.Linq.Binary VersionNumber { get; set; }