Replace long with int

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.
This commit is contained in:
Haacked
2013-09-24 14:12:50 -07:00
parent caad25abd0
commit 38264fcde5
9 changed files with 29 additions and 29 deletions

View File

@@ -21,12 +21,12 @@ namespace Octokit.Reactive.Clients
return client.GetAll().ToObservable(); return client.GetAll().ToObservable();
} }
public IObservable<Authorization> Get(long id) public IObservable<Authorization> Get(int id)
{ {
return client.Get(id).ToObservable(); return client.Get(id).ToObservable();
} }
public IObservable<Authorization> Update(long id, AuthorizationUpdate authorization) public IObservable<Authorization> Update(int id, AuthorizationUpdate authorization)
{ {
Ensure.ArgumentNotNull(authorization, "authorization"); Ensure.ArgumentNotNull(authorization, "authorization");
@@ -40,7 +40,7 @@ namespace Octokit.Reactive.Clients
return client.Create(authorization).ToObservable(); return client.Create(authorization).ToObservable();
} }
public IObservable<Unit> Delete(long id) public IObservable<Unit> Delete(int id)
{ {
return client.Delete(id).ToObservable(); return client.Delete(id).ToObservable();
} }

View File

@@ -16,7 +16,7 @@ namespace Octokit.Reactive.Clients
this.client = client; this.client = client;
} }
public IObservable<SshKey> Get(long id) public IObservable<SshKey> Get(int id)
{ {
return client.Get(id).ToObservable(); return client.Get(id).ToObservable();
} }
@@ -40,14 +40,14 @@ namespace Octokit.Reactive.Clients
return client.Create(key).ToObservable(); return client.Create(key).ToObservable();
} }
public IObservable<SshKey> Update(long id, SshKeyUpdate key) public IObservable<SshKey> Update(int id, SshKeyUpdate key)
{ {
Ensure.ArgumentNotNull(key, "key"); Ensure.ArgumentNotNull(key, "key");
return client.Update(id, key).ToObservable(); return client.Update(id, key).ToObservable();
} }
public IObservable<Unit> Delete(long id) public IObservable<Unit> Delete(int id)
{ {
return client.Delete(id).ToObservable(); return client.Delete(id).ToObservable();
} }

View File

@@ -12,9 +12,9 @@ namespace Octokit.Reactive
IObservable<IReadOnlyCollection<Authorization>> GetAll(); IObservable<IReadOnlyCollection<Authorization>> GetAll();
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get",
Justification = "It's fiiiine. It's fine. Trust us.")] Justification = "It's fiiiine. It's fine. Trust us.")]
IObservable<Authorization> Get(long id); IObservable<Authorization> Get(int id);
IObservable<Authorization> Update(long id, AuthorizationUpdate authorization); IObservable<Authorization> Update(int id, AuthorizationUpdate authorization);
IObservable<Authorization> Create(AuthorizationUpdate authorization); IObservable<Authorization> Create(AuthorizationUpdate authorization);
IObservable<Unit> Delete(long id); IObservable<Unit> Delete(int id);
} }
} }

View File

@@ -13,7 +13,7 @@ namespace Octokit.Reactive
/// <param name="id">The ID of the SSH key.</param> /// <param name="id">The ID of the SSH key.</param>
/// <returns>A <see cref="SshKey"/></returns> /// <returns>A <see cref="SshKey"/></returns>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")] [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")]
IObservable<SshKey> Get(long id); IObservable<SshKey> Get(int id);
/// <summary> /// <summary>
/// Retrieves the <see cref="SshKey"/> for the specified id. /// Retrieves the <see cref="SshKey"/> for the specified id.
@@ -46,7 +46,7 @@ namespace Octokit.Reactive
/// <param name="key"></param> /// <param name="key"></param>
/// <exception cref="AuthenticationException">Thrown if the client is not authenticated.</exception> /// <exception cref="AuthenticationException">Thrown if the client is not authenticated.</exception>
/// <returns>A <see cref="User"/></returns> /// <returns>A <see cref="User"/></returns>
IObservable<SshKey> Update(long id, SshKeyUpdate key); IObservable<SshKey> Update(int id, SshKeyUpdate key);
/// <summary> /// <summary>
/// Update the specified <see cref="UserUpdate"/>. /// Update the specified <see cref="UserUpdate"/>.
@@ -54,6 +54,6 @@ namespace Octokit.Reactive
/// <param name="id">The id of the SSH key</param> /// <param name="id">The id of the SSH key</param>
/// <exception cref="AuthenticationException">Thrown if the client is not authenticated.</exception> /// <exception cref="AuthenticationException">Thrown if the client is not authenticated.</exception>
/// <returns>A <see cref="User"/></returns> /// <returns>A <see cref="User"/></returns>
IObservable<Unit> Delete(long id); IObservable<Unit> Delete(int id);
} }
} }

View File

@@ -27,7 +27,7 @@ namespace Octokit.Clients
/// </summary> /// </summary>
/// <param name="id">The id of the <see cref="Authorization"/>.</param> /// <param name="id">The id of the <see cref="Authorization"/>.</param>
/// <returns>An <see cref="Authorization"/></returns> /// <returns>An <see cref="Authorization"/></returns>
public async Task<Authorization> Get(long id) public async Task<Authorization> Get(int id)
{ {
var endpoint = "/authorizations/{0}".FormatUri(id); var endpoint = "/authorizations/{0}".FormatUri(id);
return await Client.Get(endpoint); return await Client.Get(endpoint);
@@ -39,7 +39,7 @@ namespace Octokit.Clients
/// <param name="id">The id of the <see cref="Authorization"/>.</param> /// <param name="id">The id of the <see cref="Authorization"/>.</param>
/// <param name="authorization"></param> /// <param name="authorization"></param>
/// <returns></returns> /// <returns></returns>
public async Task<Authorization> Update(long id, AuthorizationUpdate authorization) public async Task<Authorization> Update(int id, AuthorizationUpdate authorization)
{ {
Ensure.ArgumentNotNull(authorization, "authorization"); Ensure.ArgumentNotNull(authorization, "authorization");
@@ -64,7 +64,7 @@ namespace Octokit.Clients
/// </summary> /// </summary>
/// <param name="id">The systemwide id of the authorization</param> /// <param name="id">The systemwide id of the authorization</param>
/// <returns></returns> /// <returns></returns>
public async Task Delete(long id) public async Task Delete(int id)
{ {
var endpoint = "/authorizations/{0}".FormatUri(id); var endpoint = "/authorizations/{0}".FormatUri(id);
await Client.Delete(endpoint); await Client.Delete(endpoint);

View File

@@ -11,7 +11,7 @@ namespace Octokit.Clients
{ {
} }
public async Task<SshKey> Get(long id) public async Task<SshKey> Get(int id)
{ {
var endpoint = "/user/keys/{0}".FormatUri(id); var endpoint = "/user/keys/{0}".FormatUri(id);
@@ -42,7 +42,7 @@ namespace Octokit.Clients
return await Client.Create(endpoint, key); return await Client.Create(endpoint, key);
} }
public async Task<SshKey> Update(long id, SshKeyUpdate key) public async Task<SshKey> Update(int id, SshKeyUpdate key)
{ {
Ensure.ArgumentNotNull(key, "key"); Ensure.ArgumentNotNull(key, "key");
@@ -50,7 +50,7 @@ namespace Octokit.Clients
return await Client.Update(endpoint, key); return await Client.Update(endpoint, key);
} }
public async Task Delete(long id) public async Task Delete(int id)
{ {
var endpoint = "/user/keys/{0}".FormatUri(id); var endpoint = "/user/keys/{0}".FormatUri(id);

View File

@@ -208,7 +208,7 @@ namespace Octokit
/// <summary> /// <summary>
/// The system-wide unique Id for this user. /// The system-wide unique Id for this user.
/// </summary> /// </summary>
public long Id { get; set; } public int Id { get; set; }
/// <summary> /// <summary>
/// The geographic location of this user. /// The geographic location of this user.
@@ -282,7 +282,7 @@ namespace Octokit
/// <summary> /// <summary>
/// The system-wide unique Id for this user. /// The system-wide unique Id for this user.
/// </summary> /// </summary>
public long Id { get; set; } public int Id { get; set; }
/// <summary> /// <summary>
/// This org's login. /// This org's login.
@@ -342,7 +342,7 @@ namespace Octokit
/// <summary> /// <summary>
/// The system-wide unique Id for this user. /// The system-wide unique Id for this user.
/// </summary> /// </summary>
public long Id { get; set; } public int Id { get; set; }
/// <summary> /// <summary>
/// The SSH Key /// The SSH Key
@@ -414,7 +414,7 @@ namespace Octokit
/// <summary> /// <summary>
/// The amount of disk space allowed with this plan. /// The amount of disk space allowed with this plan.
/// </summary> /// </summary>
public long Space { get; set; } public int Space { get; set; }
} }
public class Repository public class Repository
@@ -426,7 +426,7 @@ namespace Octokit
public string SshUrl { get; set; } public string SshUrl { get; set; }
public string SvnUrl { get; set; } public string SvnUrl { get; set; }
public string MirrorUrl { get; set; } public string MirrorUrl { get; set; }
public long Id { get; set; } public int Id { get; set; }
public User Owner { get; set; } public User Owner { get; set; }
public string Name { get; set; } public string Name { get; set; }
public string FullName { get; set; } public string FullName { get; set; }

View File

@@ -11,9 +11,9 @@ namespace Octokit
Task<IReadOnlyCollection<Authorization>> GetAll(); Task<IReadOnlyCollection<Authorization>> GetAll();
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get",
Justification = "It's fiiiine. It's fine. Trust us.")] Justification = "It's fiiiine. It's fine. Trust us.")]
Task<Authorization> Get(long id); Task<Authorization> Get(int id);
Task<Authorization> Update(long id, AuthorizationUpdate authorization); Task<Authorization> Update(int id, AuthorizationUpdate authorization);
Task<Authorization> Create(AuthorizationUpdate authorization); Task<Authorization> Create(AuthorizationUpdate authorization);
Task Delete(long id); Task Delete(int id);
} }
} }

View File

@@ -12,7 +12,7 @@ namespace Octokit
/// <param name="id">The ID of the SSH key.</param> /// <param name="id">The ID of the SSH key.</param>
/// <returns>A <see cref="SshKey"/></returns> /// <returns>A <see cref="SshKey"/></returns>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")] [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")]
Task<SshKey> Get(long id); Task<SshKey> Get(int id);
/// <summary> /// <summary>
/// Retrieves the <see cref="SshKey"/> for the specified id. /// Retrieves the <see cref="SshKey"/> for the specified id.
@@ -45,7 +45,7 @@ namespace Octokit
/// <param name="key"></param> /// <param name="key"></param>
/// <exception cref="AuthenticationException">Thrown if the client is not authenticated.</exception> /// <exception cref="AuthenticationException">Thrown if the client is not authenticated.</exception>
/// <returns>A <see cref="User"/></returns> /// <returns>A <see cref="User"/></returns>
Task<SshKey> Update(long id, SshKeyUpdate key); Task<SshKey> Update(int id, SshKeyUpdate key);
/// <summary> /// <summary>
/// Update the specified <see cref="UserUpdate"/>. /// Update the specified <see cref="UserUpdate"/>.
@@ -53,6 +53,6 @@ namespace Octokit
/// <param name="id">The id of the SSH key</param> /// <param name="id">The id of the SSH key</param>
/// <exception cref="AuthenticationException">Thrown if the client is not authenticated.</exception> /// <exception cref="AuthenticationException">Thrown if the client is not authenticated.</exception>
/// <returns>A <see cref="User"/></returns> /// <returns>A <see cref="User"/></returns>
Task Delete(long id); Task Delete(int id);
} }
} }