/// <summary> /// Restores inner state of an already created object passed in <paramref name="obj"/> parameter based on a saved XML. /// Works for results of <see cref="SerializeContent(XElement,object,XmlSerializationOptions)"/> and other <c>SerializeContent</c> overloads. /// </summary> /// <param name="obj">The already constructed object whose inner state has to be deserialized.</param> /// <param name="content">XML content of the object.</param> /// <exception cref="ArgumentNullException"><paramref name="obj"/> and <paramref name="content"/> must not be <see langword="null"/>.</exception> /// <exception cref="ArgumentException"><paramref name="obj"/> must not be a value type.</exception> /// <exception cref="NotSupportedException">Deserializing an inner type is not supported.</exception> /// <exception cref="ReflectionException">An inner type cannot be instantiated or serialized XML content is corrupt.</exception> /// <exception cref="ArgumentException">XML content is inconsistent or corrupt.</exception> public static void DeserializeContent(XElement content, object obj) => XElementDeserializer.DeserializeContent(content, obj);
/// <summary> /// Deserializes an XML content to an object. /// Works for results of <see cref="Serialize(object,XmlSerializationOptions)"/> method. /// </summary> /// <param name="content">XML content of the object.</param> /// <returns>The deserialized object.</returns> /// <exception cref="ArgumentNullException"><paramref name="content"/> must not be <see langword="null"/>.</exception> /// <exception cref="NotSupportedException">Deserializing an inner type is not supported.</exception> /// <exception cref="ReflectionException">An inner type cannot be instantiated or serialized XML content is corrupt.</exception> /// <exception cref="ArgumentException">XML content is inconsistent or corrupt.</exception> public static object Deserialize(XElement content) => XElementDeserializer.Deserialize(content);