Exemple #1
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();
     }
 }
Exemple #2
0
        public static void Go()
        {
            var creator = new OrgHierarchyCreator();

            creator.CreateBrandsAndDivisions();
            creator.CreateRegions();
            creator.CreateDistricts();
        }