예제 #1
0
		public Task<IEnumerable<Repository>> GetOrganizationRepositoriesAsync(string organization, RepositoryQueryType type, int pageSize)
		{
			if (type == RepositoryQueryType.Owner)
			{
				throw new NotSupportedException();
			}

			return this.GetRepositoriesCore(string.Format("/orgs/{0}/repos?type={1}&per_page={2}", organization, queryTypes[type], pageSize));
		}
예제 #2
0
 private static object ReturnForRepository(EntityList list, RepositoryQueryType queryType)
 {
     switch (queryType)
     {
         case RepositoryQueryType.First:
             return DisconnectFirst(list);
         case RepositoryQueryType.Count:
             return list.TotalCount;
         case RepositoryQueryType.Table:
             throw new InvalidOperationException();
         case RepositoryQueryType.List:
         default:
             return list;
     }
 }
예제 #3
0
 internal void SetQueryType(RepositoryQueryType value)
 {
     _queryType = value;
 }
예제 #4
0
		public Task<IEnumerable<Repository>> GetRepositoriesAsync(RepositoryQueryType type,
			RepositoryQuerySort sort, RepositoryQueryDirection direction)
		{
			return this.GetRepositoriesCore(string.Format("/user/repos?type={0}&sort={1}&direction={2}",
				queryTypes[type], querySorts[sort], queryDirections[direction]));
		}
예제 #5
0
		public Task<IEnumerable<Repository>> GetRepositoriesAsync(RepositoryQueryType type)
		{
			return this.GetRepositoriesCore(string.Format("/user/repos?type={0}", queryTypes[type]));
		}
예제 #6
0
		public Task<IEnumerable<Repository>> GetUserRepositoriesAsync(string username, RepositoryQueryType type)
		{
			if (type == RepositoryQueryType.Private && type == RepositoryQueryType.Public)
			{
				throw new NotSupportedException();
			}

			return this.GetRepositoriesCore(string.Format("/users/{0}/repos?type={1}", username, queryTypes[type]));
		}