Exemplo n.º 1
0
        public static void Go()
        {
            OrgHierarchyCreator creator = new OrgHierarchyCreator();
            var parent = creator.GetEnterpriseOrgUnit();

            creator.CreateBrandsAndDivisions(parent);
        }
Exemplo n.º 2
0
 public static void Main(string[] args)
 {
     try
     {
         OrgHierarchyCreator.Go();
     }
     catch (AggregateException aggregateException)
     {
         var innerException = aggregateException.InnerException;
         if (innerException is ApiException)
         {
             var apiException = innerException as ApiException;
             var responseBody = apiException.Response.Content.ReadAsStringAsync().Result;
             Console.Error.WriteLine(responseBody);
         }
         else
         {
             Console.Error.WriteLine(aggregateException);
         }
     }
     catch (Exception e)
     {
         Console.Error.WriteLine(e);
     }
     finally
     {
         Console.WriteLine("Finished! Press Enter");
         Console.ReadLine();
     }
 }