ubisoft/NGitLab

Recommended way to get Project Id

Closed this issue · 2 comments

gep13 commented

What is the recommended way to go from a Project URL to a Project Id, to use many of the methods that take an int parameter?

Let's say I have a GitLab Project at https://gitlab.com/gep13/grm-test, how can I find the Project Id?

I am sure that this is obvious, but couldn't find anything immediately showing how to do this.

Thanks!

You can query the project by path_with_namespace:

IGitLabClient client;
var project = client.Projects["gep13/grm-test"];
_ = project.Id;
gep13 commented

@meziantou thank you for coming back to me with this, I will take this for a spin to see if this gets me what I am looking for. Thank you!