public void WriteAllData <T>(List <T> data) where T : class
        {
            Console.WriteLine("");
            Console.WriteLine($"starting to write {data.Count} {typeof(T).Name} entries.");
            var converter = new ElasticClassConverter();
            var client    = ElasticClientManager.CreateClient();

            var type = typeof(T);

            if (data is List <User> users)
            {
                BulkWriteData(converter.Convert(users), client);
            }

            if (data is List <ElasticUserStat> userStats)
            {
                BulkWriteData(userStats, client);
            }

            if (data is List <ElasticBettingStat> bettingStats)
            {
                BulkWriteData(bettingStats, client);
            }
        }
Ejemplo n.º 2
0
 public ElasticReader()
 {
     _client = ElasticClientManager.CreateClient();
 }