Replaced read only fields by private setters in auto properties

This commit is contained in:
Gabriel Weyer
2013-12-03 09:43:50 +11:00
parent 9d51975246
commit 6d29091266
3 changed files with 44 additions and 52 deletions
@@ -4,31 +4,6 @@ namespace Octokit
{
public class PullRequestReviewCommentCreate : RequestParameters
{
private readonly string _body;
private readonly string _commitId;
private readonly string _path;
private readonly int _position;
/// <summary>
/// The text of the comment.
/// </summary>
public string Body { get { return _body; } }
/// <summary>
/// The SHA of the commit to comment on.
/// </summary>
public string CommitId { get { return _commitId; } }
/// <summary>
/// The relative path of the file to comment on.
/// </summary>
public string Path { get { return _path; } }
/// <summary>
/// The line index in the diff to comment on.
/// </summary>
public int Position { get { return _position; } }
/// <summary>
/// Creates a comment
/// </summary>
@@ -42,10 +17,32 @@ namespace Octokit
Ensure.ArgumentNotNullOrEmptyString(commitId, "commitId");
Ensure.ArgumentNotNullOrEmptyString(path, "path");
_body = body;
_commitId = commitId;
_path = path;
_position = position;
Body = body;
CommitId = commitId;
Path = path;
Position = position;
}
/// <summary>
/// The text of the comment.
/// </summary>
public string Body { get; private set; }
/// <summary>
/// The SHA of the commit to comment on.
/// </summary>
public string CommitId { get; private set; }
/// <summary>
/// The relative path of the file to comment on.
/// </summary>
public string Path { get; private set; }
/// <summary>
/// The line index in the diff to comment on.
/// </summary>
public int Position { get; private set; }
}
}
@@ -3,13 +3,6 @@ namespace Octokit
{
public class PullRequestReviewCommentEdit : RequestParameters
{
private readonly string _body;
/// <summary>
/// The text of the comment.
/// </summary>
public string Body { get { return _body; }}
/// <summary>
/// Creates an edit to a comment
/// </summary>
@@ -18,7 +11,12 @@ namespace Octokit
{
Ensure.ArgumentNotNullOrEmptyString(body, "body");
_body = body;
Body = body;
}
/// <summary>
/// The text of the comment.
/// </summary>
public string Body { get; private set; }
}
}
@@ -4,19 +4,6 @@ namespace Octokit
{
public class PullRequestReviewCommentReplyCreate : RequestParameters
{
private readonly string _body;
private readonly int _inReplyTo;
/// <summary>
/// The text of the comment.
/// </summary>
public string Body { get { return _body; } }
/// <summary>
/// The comment Id to reply to.
/// </summary>
public int InReplyTo { get { return _inReplyTo; } }
/// <summary>
/// Creates a comment that is replying to another comment.
/// </summary>
@@ -26,8 +13,18 @@ namespace Octokit
{
Ensure.ArgumentNotNullOrEmptyString(body, "body");
_body = body;
_inReplyTo = inReplyTo;
Body = body;
InReplyTo = inReplyTo;
}
/// <summary>
/// The text of the comment.
/// </summary>
public string Body { get; private set; }
/// <summary>
/// The comment Id to reply to.
/// </summary>
public int InReplyTo { get; private set; }
}
}