/// <summary> /// Deserializes the document data as the specified type. /// </summary> /// <typeparam name="T">The type to deserialize the document data as.</typeparam> /// <returns>The deserialized data, or null if this object represents a missing document.</returns> public T ConvertTo <T>() where T : class { if (!Exists) { return(null); } return((T)ValueDeserializer.DeserializeMap(Database, Document.Fields, typeof(T))); }
/// <summary> /// Deserializes the document data as the specified type. /// </summary> /// <typeparam name="T">The type to deserialize the document data as.</typeparam> /// <returns>The deserialized data, or null if this object represents a missing document.</returns> public T ConvertTo <T>() { if (!Exists) { return(default(T)); } return((T)ValueDeserializer.DeserializeMap(Database, Document.Fields, typeof(T))); }