protected object DeserializeTo(string objectData, Type type, ReadWriteAttributes attr) { var serializer = new XmlSerializer(type, attr); var result = string.Empty; using (var reader = new StringReader(objectData)) return(serializer.Deserialize(reader)); }
protected string SerializeFrom(object objectData, Type type, ReadWriteAttributes attr) { var serializer = new XmlSerializer(type, attr); using (var writer = new StringWriter()) { serializer.Serialize(writer, objectData); return(writer.ToString()); } }
protected internal T XmlDeserializeTo <T>(string objectData, ReadWriteAttributes attr) => (T)DeserializeTo(objectData, typeof(T), attr);
protected internal string XmlSerializeFrom <T>(T objectData, ReadWriteAttributes attr) => SerializeFrom(objectData, typeof(T), attr);