Example #1
0
 public static Project TeamCityProjectGet(this Context context, TeamCityProjectLocatorType projectLocatorType, string projectLocatorValue, TeamCityClientOptions options)
 {
     return(TeamCityProjectGetAsync(context, projectLocatorType, projectLocatorValue, options).Result);
 }
Example #2
0
        public static async Task <Project> TeamCityProjectGetAsync(this Context context, TeamCityProjectLocatorType projectLocatorType, string projectLocatorValue, TeamCityClientOptions options)
        {
            using (var tcc = new TeamCityClient(options))
            {
                switch (projectLocatorType)
                {
                case TeamCityProjectLocatorType.Id:
                    return(await tcc.Projects.ByIdAsync(projectLocatorValue));

                case TeamCityProjectLocatorType.Name:
                    return(await tcc.Projects.ByNameAsync(projectLocatorValue));

                default:
                    return(await tcc.Projects.ByLocatorAsync(projectLocatorValue));
                }
            }
        }