Esempio n. 1
0
        private static async Task BulkInsert()
        {
            var client = new CrateClient("http://clccontainer1.cloudapp.net:4200");
            var tweets = new List <Tweet>()
            {
                new Tweet {
                    Content = "NoSqlExplorer rocks in bulks", DoubleProp = 13.37, FloatProp = 6.999999f, Id = 13, Retweeted = false, Created = DateTime.UtcNow
                },
                new Tweet {
                    Content = "NoSqlExplorer still rocks in bulks", DoubleProp = 13.37, FloatProp = 6.999999f, Id = 14, Retweeted = false, Created = DateTime.UtcNow
                },
                new Tweet {
                    Content = "NoSqlExplorer still rocks in bulks", DoubleProp = 13.37, FloatProp = 6.999999f, Id = 15, Retweeted = false, Created = DateTime.UtcNow
                },
            };
            var response = await client.BulkInsert(tweets);

            Console.WriteLine("BulkInsert");
            Console.WriteLine(response);
        }
Esempio n. 2
0
 public async Task BulkInsertAsync(IList <Tweet> tweets)
 {
     var crateClient = new CrateClient(_crateUrl);
     await Retry.TryAwait <ICrateResponse, HttpRequestException>(() => crateClient.BulkInsert(tweets.Select(t => new CrateTweet(t))));
 }