/// <summary> /// Deserialize and return data of the specified type. /// </summary> /// <param name='dataType'> /// The type of the data. /// </param> public virtual object Deserialize(Type dataType) { if (dataType == null) { throw new ArgumentNullException("dataType"); } Type serializationType = this.SelectSerializationType(dataType); ISerializationContainer container = this.Retrieve(serializationType); return(container.Deserialize()); }
/// <summary> /// Serialize and persist the specified data. /// </summary> /// <param name='dataType'> /// The type of the data. /// </param> /// <param name='data'> /// The 'payload' data to serialize. /// </param> public virtual void Serialize(Type dataType, object data) { if (dataType == null) { throw new ArgumentNullException("dataType"); } Type serializationType = this.SelectSerializationType(dataType); ISerializationContainer container = this.CreateSerializationContainer(serializationType); container.Type = serializationType; container.Serialize(data); this.Persist(container); }
/// <summary> /// Persist the specified raw serialized data. /// </summary> /// <param name='data'> /// The raw/serialized data to persist. /// </param> public abstract void Persist(ISerializationContainer data);