Ejemplo n.º 1
0
        public WebApiTagDefinition CreateTag()
        {
            Guid   projectId = ClientSampleHelpers.FindAnyProject(this.Context).Id;
            string tagName   = "Hello World";

            VssConnection     connection    = Context.Connection;
            TaggingHttpClient taggingClient = connection.GetClient <TaggingHttpClient>();

            WebApiTagDefinition tag = taggingClient.CreateTagAsync(projectId, tagName).Result;

            Console.WriteLine("Tag '{0}' successfully created", tagName);

            return(tag);
        }
Ejemplo n.º 2
0
        public WebApiTagDefinition CreateTag()
        {
            Guid   projectId = ClientSampleHelpers.FindAnyProject(this.Context).Id;
            string tagName   = "Hello World";

            VssConnection     connection    = Context.Connection;
            TaggingHttpClient taggingClient = connection.GetClient <TaggingHttpClient>();

            try
            {
                WebApiTagDefinition tag = taggingClient.CreateTagAsync(projectId, tagName).Result;

                Console.WriteLine("Tag '{0}' successfully created", tagName);

                return(tag);
            }
            catch (AggregateException ex)
            {
                Console.WriteLine("Error: {0}", ex.InnerException.Message);
                return(null);
            }
        }