File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
templates/csharp/guides/search Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -7,13 +7,13 @@ using System.Collections.Generic;
77
88class Program
99{
10- public static void Main(string[] args)
10+ public static async Task Main(string[] args)
1111 {
1212 // read json file from url
1313 var url = " https://dashboard.algolia.com/sample_datasets/movie.json" ;
1414 var httpClient = new HttpClient();
15- var response = httpClient.GetAsync(url).Result;
16- var content = response.Content.ReadAsStringAsync().Result;
15+ var response = await httpClient.GetAsync(url)
16+ var content = await response.Content.ReadAsStringAsync()
1717
1818 // parse json
1919 var movies = JsonSerializer.Deserialize< List< dynamic>> (content);
@@ -24,7 +24,7 @@ class Program
2424 // push data to algolia
2525 try
2626 {
27- var result = {{#dynamicSnippet} }saveObjectsMovies{ {/dynamicSnippet} }.Result;
27+ var result = {{#dynamicSnippet} }saveObjectsMovies{ {/dynamicSnippet} }
2828 }
2929 catch (Exception e)
3030 {
You can’t perform that action at this time.
0 commit comments