Fix up NetCore45

This commit is contained in:
pltaylor
2013-11-04 14:14:22 -05:00
parent 8d2c2c5895
commit 138b98901b
6 changed files with 33 additions and 20 deletions
@@ -1,6 +1,7 @@

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
namespace Octokit.Reactive.Clients
@@ -26,7 +27,7 @@ namespace Octokit.Reactive.Clients
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <returns></returns>
IObservable<IReadOnlyList<IssueComment>> GetForRepository(string owner, string name);
IObservable<IssueComment> GetForRepository(string owner, string name);
/// <summary>
/// Gets Issue Comments for a specified Issue.
@@ -36,7 +37,7 @@ namespace Octokit.Reactive.Clients
/// <param name="name">The name of the repository</param>
/// <param name="number">The issue number</param>
/// <returns></returns>
IObservable<IReadOnlyList<IssueComment>> GetForIssue(string owner, string name, int number);
IObservable<IssueComment> GetForIssue(string owner, string name, int number);
/// <summary>
/// Creates a new Issue Comment for a specified Issue.
@@ -1,15 +1,19 @@
using System;
using System.Collections.Generic;
using Octokit.Reactive.Internal;
namespace Octokit.Reactive.Clients
{
class ObservableIssueCommentsClient : IObservableIssueCommentsClient
{
readonly IIssuesClient _client;
readonly IConnection _connection;
public ObservableIssueCommentsClient(IGitHubClient client)
{
Ensure.ArgumentNotNull(client, "client");
_client = client.Issue;
_connection = client.Connection;
}
/// <summary>
@@ -24,10 +28,11 @@ namespace Octokit.Reactive.Clients
/// <returns>The <see cref="IssueComment"/>s for the specified Issue Comment.</returns>
public IObservable<IssueComment> Get(string owner, string name, int number)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
//Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
//Ensure.ArgumentNotNullOrEmptyString(name, "name");
return _connection.Get<IssueComment>(ApiUrls.IssueComment(owner, name, number));
//return _client.Get<IssueComment>(ApiUrls.IssueComment(owner, name, number));
throw new NotImplementedException();
}
/// <summary>
@@ -39,12 +44,12 @@ namespace Octokit.Reactive.Clients
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <returns>The list of <see cref="IssueComment"/>s for the specified Repository.</returns>
public IObservable<IReadOnlyList<IssueComment>> GetForRepository(string owner, string name)
public IObservable<IssueComment> GetForRepository(string owner, string name)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
return _connection.GetAll<IssueComment>(ApiUrls.IssueComments(owner, name));
return _connection.GetAndFlattenAllPages<IssueComment>(ApiUrls.IssueComments(owner, name));
}
/// <summary>
@@ -57,12 +62,12 @@ namespace Octokit.Reactive.Clients
/// <param name="name">The name of the repository</param>
/// <param name="number">The issue number</param>
/// <returns>The list of <see cref="IssueComment"/>s for the specified Issue.</returns>
public IObservable<IReadOnlyList<IssueComment>> GetForIssue(string owner, string name, int number)
public IObservable<IssueComment> GetForIssue(string owner, string name, int number)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
return _connection.GetAll<IssueComment>(ApiUrls.IssueComments(owner, name, number));
return _connection.GetAndFlattenAllPages<IssueComment>(ApiUrls.IssueComments(owner, name, number));
}
/// <summary>
@@ -78,11 +83,12 @@ namespace Octokit.Reactive.Clients
/// <returns>The <see cref="IssueComment"/>s for that was just created.</returns>
public IObservable<IssueComment> 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<IssueComment>(ApiUrls.IssueComments(owner, name, number), newComment);
//return _connection.Post<IssueComment>(ApiUrls.IssueComments(owner, name, number), newComment);
throw new NotImplementedException();
}
/// <summary>
@@ -98,11 +104,13 @@ namespace Octokit.Reactive.Clients
/// <returns>The <see cref="IssueComment"/>s for that was just updated.</returns>
public IObservable<IssueComment> 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<IssueComment>(ApiUrls.IssueComment(owner, name, number), commentUpdate);
//return _connection.Patch<IssueComment>(ApiUrls.IssueComment(owner, name, number), commentUpdate);
throw new NotImplementedException();
}
}
}
+2 -1
View File
@@ -1,4 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
namespace Octokit
+1
View File
@@ -1,4 +1,5 @@

using System.Collections.Generic;
using System.Threading.Tasks;
namespace Octokit
+3
View File
@@ -54,6 +54,7 @@
<Compile Include="Clients\IAuthorizationsClient.cs" />
<Compile Include="Clients\ICommitStatusClient.cs" />
<Compile Include="Clients\IGitDatabaseClient.cs" />
<Compile Include="Clients\IIssueCommentsClient.cs" />
<Compile Include="Clients\IIssuesClient.cs" />
<Compile Include="Clients\IIssuesEventsClient.cs" />
<Compile Include="Clients\IMilestonesClient.cs" />
@@ -63,6 +64,7 @@
<Compile Include="Clients\IReleasesClient.cs" />
<Compile Include="Clients\IRepositoriesClient.cs" />
<Compile Include="Clients\ISshKeysClient.cs" />
<Compile Include="Clients\IssueCommentsClient.cs" />
<Compile Include="Clients\IssuesClient.cs" />
<Compile Include="Clients\ITagsClient.cs" />
<Compile Include="Clients\IssuesEventsClient.cs" />
@@ -126,6 +128,7 @@
<Compile Include="Http\IRequest.cs" />
<Compile Include="Http\IResponse.cs" />
<Compile Include="Http\Request.cs" />
<Compile Include="Models\IssueComment.cs" />
<Compile Include="Models\Request\AuthorizationUpdate.cs" />
<Compile Include="Models\Request\IssueRequest.cs" />
<Compile Include="Models\Request\IssueUpdate.cs" />
+1 -2
View File
@@ -56,7 +56,6 @@
<Compile Include="Clients\IIssuesEventsClient.cs" />
<Compile Include="Clients\ICommitStatusClient.cs" />
<Compile Include="Clients\IGitDatabaseClient.cs" />
<Compile Include="Clients\IIssuesCommentClient.cs" />
<Compile Include="Clients\IIssueCommentsClient.cs" />
<Compile Include="Clients\IssueCommentsClient.cs" />
<Compile Include="Clients\IssuesClient.cs" />
@@ -214,4 +213,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>