コード例 #1
0
        private static void Provision()
        {
            var builder = new ConfigurationBuilder();

            builder.SetBasePath(Directory.GetCurrentDirectory());
            builder.AddUserSecrets();

            var configuration       = builder.Build();
            var searchServiceClient = new SearchServiceClient(configuration["Search:ServiceName"], new SearchCredentials(configuration["Search:AdminKey"]));

            var index = new BookFastIndex(searchServiceClient, configuration);

            index.ProvisionAsync().Wait();
        }
コード例 #2
0
        private static void Provision()
        {
            var builder = new ConfigurationBuilder();

            builder.SetBasePath(Directory.GetCurrentDirectory());
            builder.AddUserSecrets <Program>();

            var configuration = builder.Build();

            var endpoint            = new Uri(configuration["Search:ServiceEndpoint"]);
            var credential          = new AzureKeyCredential(configuration["Search:AdminKey"]);
            var searchServiceClient = new SearchIndexClient(endpoint, credential);

            var index = new BookFastIndex(searchServiceClient, configuration);

            index.ProvisionAsync().Wait();
        }