mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-20 22:25:12 +00:00
Turns out that we store these values as int(11) in MySql. The 11 is irrelevant and pertains to display. int is a 4 byte (aka 32 bit) integer. So this maps to a .NET Int32 (aka int). While changing keeping it long might be future proofing, it also requires changes to GHfW and I figure let's jump that hurdle when we get there.
49 lines
1.3 KiB
C#
49 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Reactive;
|
|
using System.Reactive.Threading.Tasks;
|
|
|
|
namespace Octokit.Reactive.Clients
|
|
{
|
|
public class ObservableAuthorizationsClient : IObservableAuthorizationsClient
|
|
{
|
|
readonly IAuthorizationsClient client;
|
|
|
|
public ObservableAuthorizationsClient(IAuthorizationsClient client)
|
|
{
|
|
Ensure.ArgumentNotNull(client, "client");
|
|
|
|
this.client = client;
|
|
}
|
|
|
|
public IObservable<IReadOnlyCollection<Authorization>> GetAll()
|
|
{
|
|
return client.GetAll().ToObservable();
|
|
}
|
|
|
|
public IObservable<Authorization> Get(int id)
|
|
{
|
|
return client.Get(id).ToObservable();
|
|
}
|
|
|
|
public IObservable<Authorization> Update(int id, AuthorizationUpdate authorization)
|
|
{
|
|
Ensure.ArgumentNotNull(authorization, "authorization");
|
|
|
|
return client.Update(id, authorization).ToObservable();
|
|
}
|
|
|
|
public IObservable<Authorization> Create(AuthorizationUpdate authorization)
|
|
{
|
|
Ensure.ArgumentNotNull(authorization, "authorization");
|
|
|
|
return client.Create(authorization).ToObservable();
|
|
}
|
|
|
|
public IObservable<Unit> Delete(int id)
|
|
{
|
|
return client.Delete(id).ToObservable();
|
|
}
|
|
}
|
|
}
|