diff --git a/Octokit.Reactive/Clients/IObservableIssueCommentsClient.cs b/Octokit.Reactive/Clients/IObservableIssueCommentsClient.cs
index fb003b50..ce8483fa 100644
--- a/Octokit.Reactive/Clients/IObservableIssueCommentsClient.cs
+++ b/Octokit.Reactive/Clients/IObservableIssueCommentsClient.cs
@@ -4,7 +4,7 @@ using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
-namespace Octokit.Reactive.Clients
+namespace Octokit.Reactive
{
public interface IObservableIssueCommentsClient
{
@@ -27,7 +27,7 @@ namespace Octokit.Reactive.Clients
/// The owner of the repository
/// The name of the repository
///
- IObservable GetForRepository(string owner, string name);
+ IObservable> GetForRepository(string owner, string name);
///
/// Gets Issue Comments for a specified Issue.
@@ -37,7 +37,7 @@ namespace Octokit.Reactive.Clients
/// The name of the repository
/// The issue number
///
- IObservable GetForIssue(string owner, string name, int number);
+ IObservable> GetForIssue(string owner, string name, int number);
///
/// Creates a new Issue Comment for a specified Issue.
diff --git a/Octokit.Reactive/Clients/ObservableIssueCommentsClient.cs b/Octokit.Reactive/Clients/ObservableIssueCommentsClient.cs
index 6076d38c..b621fd1d 100644
--- a/Octokit.Reactive/Clients/ObservableIssueCommentsClient.cs
+++ b/Octokit.Reactive/Clients/ObservableIssueCommentsClient.cs
@@ -1,21 +1,20 @@
using System;
using System.Collections.Generic;
-using Octokit.Reactive.Internal;
+using System.Reactive.Threading.Tasks;
-namespace Octokit.Reactive.Clients
+namespace Octokit.Reactive
{
class ObservableIssueCommentsClient : IObservableIssueCommentsClient
{
- readonly IIssuesClient _client;
- readonly IConnection _connection;
+ readonly IIssueCommentsClient _client;
public ObservableIssueCommentsClient(IGitHubClient client)
{
Ensure.ArgumentNotNull(client, "client");
- _client = client.Issue;
- _connection = client.Connection;
+ _client = client.Issue.Comment;
}
+
///
/// Gets a single Issue Comment by number.
///
@@ -28,11 +27,10 @@ namespace Octokit.Reactive.Clients
/// The s for the specified Issue Comment.
public IObservable Get(string owner, string name, int number)
{
- //Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
- //Ensure.ArgumentNotNullOrEmptyString(name, "name");
+ Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
+ Ensure.ArgumentNotNullOrEmptyString(name, "name");
- //return _client.Get(ApiUrls.IssueComment(owner, name, number));
- throw new NotImplementedException();
+ return _client.Get(owner, name, number).ToObservable();
}
///
@@ -44,12 +42,12 @@ namespace Octokit.Reactive.Clients
/// The owner of the repository
/// The name of the repository
/// The list of s for the specified Repository.
- public IObservable GetForRepository(string owner, string name)
+ public IObservable> GetForRepository(string owner, string name)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
- return _connection.GetAndFlattenAllPages(ApiUrls.IssueComments(owner, name));
+ return _client.GetForRepository(owner, name).ToObservable();
}
///
@@ -62,12 +60,12 @@ namespace Octokit.Reactive.Clients
/// The name of the repository
/// The issue number
/// The list of s for the specified Issue.
- public IObservable GetForIssue(string owner, string name, int number)
+ public IObservable> GetForIssue(string owner, string name, int number)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
- return _connection.GetAndFlattenAllPages(ApiUrls.IssueComments(owner, name, number));
+ return _client.GetForIssue(owner, name, number).ToObservable();
}
///
@@ -83,12 +81,11 @@ namespace Octokit.Reactive.Clients
/// The s for that was just created.
public IObservable Create(string owner, string name, int number, string newComment)
{
- //Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
- //Ensure.ArgumentNotNullOrEmptyString(name, "name");
- //Ensure.ArgumentNotNull(newComment, "newComment");
+ Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
+ Ensure.ArgumentNotNullOrEmptyString(name, "name");
+ Ensure.ArgumentNotNull(newComment, "newComment");
- //return _connection.Post(ApiUrls.IssueComments(owner, name, number), newComment);
- throw new NotImplementedException();
+ return _client.Create(owner, name, number, newComment).ToObservable();
}
///
@@ -104,13 +101,11 @@ namespace Octokit.Reactive.Clients
/// The s for that was just updated.
public IObservable Update(string owner, string name, int number, string commentUpdate)
{
- //Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
- //Ensure.ArgumentNotNullOrEmptyString(name, "name");
- //Ensure.ArgumentNotNull(commentUpdate, "commentUpdate");
+ Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
+ Ensure.ArgumentNotNullOrEmptyString(name, "name");
+ Ensure.ArgumentNotNull(commentUpdate, "commentUpdate");
- //return _connection.Patch(ApiUrls.IssueComment(owner, name, number), commentUpdate);
-
- throw new NotImplementedException();
+ return _client.Update(owner, name, number, commentUpdate).ToObservable();
}
}
}
diff --git a/Octokit.Reactive/Clients/ObservableIssuesClient.cs b/Octokit.Reactive/Clients/ObservableIssuesClient.cs
index e5e160dd..38db8211 100644
--- a/Octokit.Reactive/Clients/ObservableIssuesClient.cs
+++ b/Octokit.Reactive/Clients/ObservableIssuesClient.cs
@@ -13,6 +13,7 @@ namespace Octokit.Reactive
public IObservableAssigneesClient Assignee { get; private set; }
public IObservableMilestonesClient Milestone { get; private set; }
+ public IObservableIssueCommentsClient Comments { get; private set; }
public ObservableIssuesClient(IGitHubClient client)
{
@@ -22,6 +23,7 @@ namespace Octokit.Reactive
_connection = client.Connection;
Assignee = new ObservableAssigneesClient(client);
Milestone = new ObservableMilestonesClient(client);
+ Comments = new ObservableIssueCommentsClient(client);
}
///
diff --git a/Octokit/Octokit-netcore45.csproj b/Octokit/Octokit-netcore45.csproj
index 42a6a3c1..23751a56 100644
--- a/Octokit/Octokit-netcore45.csproj
+++ b/Octokit/Octokit-netcore45.csproj
@@ -128,7 +128,6 @@
-
@@ -155,6 +154,7 @@
+