Skip to content

Commit 1a013e3

Browse files
committed
Organizations bit, renamed assembly to Git.hub
1 parent 0bf45ce commit 1a013e3

File tree

4 files changed

+34
-3
lines changed

4 files changed

+34
-3
lines changed

Git.hub/Client.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ public IList<Repository> getOrganizationRepositories(string organization)
9999
request.AddUrlSegment("org", organization);
100100

101101
var list = client.Get<List<Repository>>(request).Data;
102-
list.ForEach(r => r._client = client);
102+
103+
Organization org = new Organization { Login = organization };
104+
list.ForEach(r => { r._client = client; r.Organization = org; });
103105
return list;
104106
}
105107
}

Git.hub/Git.hub.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<ProjectGuid>{F50B1DBF-1C9F-4437-87EC-7ABA805CC446}</ProjectGuid>
99
<OutputType>Library</OutputType>
1010
<AppDesignerFolder>Properties</AppDesignerFolder>
11-
<RootNamespace>hub</RootNamespace>
12-
<AssemblyName>hub</AssemblyName>
11+
<RootNamespace>Git.hub</RootNamespace>
12+
<AssemblyName>Git.hub</AssemblyName>
1313
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
1414
<FileAlignment>512</FileAlignment>
1515
<TargetFrameworkProfile />
@@ -40,6 +40,7 @@
4040
<ItemGroup>
4141
<Compile Include="Branch.cs" />
4242
<Compile Include="Client.cs" />
43+
<Compile Include="Organization.cs" />
4344
<Compile Include="Properties\AssemblyInfo.cs" />
4445
<Compile Include="PullRequest.cs" />
4546
<Compile Include="Repository.cs" />

Git.hub/Organization.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
6+
namespace Git.hub
7+
{
8+
public class Organization
9+
{
10+
public string Login { get; internal set; }
11+
12+
public override bool Equals(object obj)
13+
{
14+
return GetHashCode() == obj.GetHashCode();
15+
}
16+
17+
public override int GetHashCode()
18+
{
19+
return GetType().GetHashCode() + Login.GetHashCode();
20+
}
21+
22+
public override string ToString()
23+
{
24+
return Login;
25+
}
26+
}
27+
}

Git.hub/Repository.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public class Repository
1515
public bool Fork { get; private set; }
1616
public int Forks { get; private set; }
1717
public bool Private { get; private set; }
18+
public Organization Organization { get; internal set; }
1819

1920
private Repository _Parent;
2021
public Repository Parent

0 commit comments

Comments
 (0)