Skip to content

Commit f4a5a44

Browse files
authored
Merge pull request #209 from jkrejcha/feature-public-rawjson
Implement a workaround for #195.
2 parents 57099a4 + 65d4dc3 commit f4a5a44

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

RedditSharp/Things/Thing.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,16 @@ public class Thing : RedditObject
4343
/// </summary>
4444
public TimeSpan TimeSinceFetch => DateTime.Now - FetchedAt;
4545

46-
private JToken RawJson { get; set; }
46+
public JToken RawJson { get; private set; }
4747

4848
/// <summary>
49-
/// Gets a property of this Thing, without any automatic conversion.
49+
/// Gets a property of this Thing without any automatic conversion,
50+
/// even to a <see cref="String"/>.
5051
/// </summary>
5152
/// <param name="property">The reddit API name of the property</param>
5253
/// <returns>The property's value as a <see cref="String"/> or null if the property
5354
/// doesn't exist or is null.</returns>
54-
public String this[String property] => RawJson[property].ValueOrDefault<string>();
55+
public JToken this[String property] => RawJson[property];
5556
#endregion
5657

5758

0 commit comments

Comments
 (0)