AzureSearchBackupRestore.Program.CreateTargetIndex C# (CSharp) Метод

CreateTargetIndex() статический приватный Метод

static private CreateTargetIndex ( string IndexName ) : void
IndexName string
Результат void
        static void CreateTargetIndex(string IndexName)
        {
            // Use the schema file to create a copy of this index
            // I like using REST here since I can just take the response as-is
            string json = File.ReadAllText("..\\..\\..\\..\\NYCJobsWeb\\Schema_and_Data\\" + IndexName + ".schema");
            try
            {
                Uri uri = new Uri(ServiceUri, "/indexes");
                HttpResponseMessage response = AzureSearchHelper.SendSearchRequest(HttpClient, HttpMethod.Post, uri, json);
                response.EnsureSuccessStatusCode();
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error: {0}", ex.Message.ToString());
            }
        }