private BqPostModel GetBqPost(string accountName, string permlink) { var blogPost = new BqPostModel(); try { using (var csteemd = new CSteemd(ConfigurationHelper.HostName)) { var response = csteemd.get_discussion(accountName, permlink); if (response != null) { var discModel = response.ToObject <GetDiscussionModel>(); blogPost = response.ToObject <BqPostModel>(); blogPost.id = discModel.post_id; blogPost.created = discModel.created.ToString("yyyy-MM-dd HH:mm:ss"); } } } catch (Exception ex) { _log.Error(ex); } return(blogPost); }
/// <summary> /// This method gets the post details response from Steem API /// </summary> /// <param name="accountName">The name of the account</param> /// <param name="permlink">The permlink of the post</param> /// <returns>Returns the result mapped to <see cref="GetDiscussionModel" /></returns> private GetDiscussionModel GetDiscussion(string accountName, string permlink) { var blogPost = new GetDiscussionModel(); try { using (var csteemd = new CSteemd(ConfigurationHelper.HostName)) { var response = csteemd.get_discussion(accountName, permlink); if (response != null) { blogPost = response.ToObject <GetDiscussionModel>(); } } } catch (Exception ex) { _log.Error(ex); } return(blogPost); }