public static string Serialize(object value, [NotNull] XmlTypeMapping mapping, XmlWriterSettings writerSettings = null) { if (value.IsNull()) { return(null); } XmlSerializer serializer = CreateSerializer(mapping); return(Serialize(value, serializer, writerSettings ?? XmlWriterHelper.CreateSettings())); }
public static string Serialize(object value, XmlSerializerSettings settings = null, XmlWriterSettings writerSettings = null) { if (value.IsNull()) { return(null); } XmlSerializer serializer = CreateSerializer(value.GetType(), settings); return(Serialize(value, serializer, writerSettings ?? XmlWriterHelper.CreateSettings())); }
public static string Serialize <T>([NotNull] T value, XmlSerializerSettings settings = null, XmlWriterSettings writerSettings = null) { if (value.IsNull()) { return(null); } XmlSerializer serializer = CreateSerializer <T>(settings); return(Serialize(value, serializer, writerSettings ?? XmlWriterHelper.CreateSettings())); }
public static string Serialize <T>([NotNull] T value, [NotNull] XmlSerializer serializer, XmlWriterSettings writerSettings = null) { return(value.IsNull() ? null : Serialize((object)value, serializer, writerSettings ?? XmlWriterHelper.CreateSettings())); }