public string GetCommentForPost(string postID) { SQLCmd_GetBotComment.Parameters["@postID"].Value = postID; string botReplyID = Convert.ToString(SQLCmd_GetBotComment.ExecuteScalar()); if (string.IsNullOrWhiteSpace(botReplyID)) { throw new InvalidOperationException($"Comment ID for post {postID} is null or empty"); } return(botReplyID); }
private bool disposedValue = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { SQLCmd_AddBotComment.Dispose(); SQLCmd_AddCheckedComment.Dispose(); SQLCmd_DoesBotCommentExist.Dispose(); SQLCmd_GetBotComment.Dispose(); SQLCmd_HasCommentBeenChecked.Dispose(); SQLCmd_HasPostBeenChecked.Dispose(); SQLCmd_AddCheckedPost.Dispose(); SQLCmd_UpdateBotComment.Dispose(); dbConnection.Dispose(); // TODO: dispose managed state (managed objects). } // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below. // TODO: set large fields to null. disposedValue = true; } }