Skip to content

Commit 28170ab

Browse files
SteppermanStepperman
authored andcommitted
GetSubreddit now returns a subreddit.
SubredditName returns the post's Subreddit name.
1 parent 782c26d commit 28170ab

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

RedditSharp/Things/Post.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,16 @@ public Comment[] Comments
124124
public string Title { get; set; }
125125

126126
[JsonProperty("subreddit")]
127-
public string Subreddit { get; set; }
127+
public string SubredditName { get; set; }
128+
129+
[JsonIgnore]
130+
public Subreddit GetSubreddit
131+
{
132+
get
133+
{
134+
return Reddit.GetSubreddit("/r/" + SubredditName);
135+
}
136+
}
128137

129138
[JsonProperty("url")]
130139
[JsonConverter(typeof(UrlParser))]

0 commit comments

Comments
 (0)