Skip to content

Commit

Permalink
Merge pull request #319 from zapadi/#304-Project-Memberships-only-acc…
Browse files Browse the repository at this point in the history
…ess-one-of-two-routes

Added GetProjectMemberships extension
  • Loading branch information
zapadi authored Mar 28, 2023
2 parents 810480c + a4df0e6 commit 9b34777
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/redmine-net-api/Extensions/RedmineManagerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,15 @@ public static News AddProjectNews(this RedmineManager redmineManager, string pro

return WebApiHelper.ExecuteUpload<News>(redmineManager, Uri.EscapeUriString($"{redmineManager.Host}/project/{projectIdentifier}/news.{redmineManager.Format}"), HttpVerbs.POST, data);
}

public static PagedResults<ProjectMembership> GetProjectMemberships(this RedmineManager redmineManager, string projectIdentifier, NameValueCollection nameValueCollection)
{
if (projectIdentifier.IsNullOrWhiteSpace())
{
throw new RedmineException($"Argument '{nameof(projectIdentifier)}' is null");
}

return WebApiHelper.ExecuteDownloadList<ProjectMembership>(redmineManager, Uri.EscapeUriString($"{redmineManager.Host}/project/{projectIdentifier}/memberships.{redmineManager.Format}"), nameValueCollection);
}
}
}

0 comments on commit 9b34777

Please sign in to comment.