diff --git a/Apache-IoTDB-Client-CSharp-UserCase/Apache-IoTDB-Client-CSharp-UserCase.csproj b/Apache-IoTDB-Client-CSharp-UserCase/Apache-IoTDB-Client-CSharp-UserCase.csproj
index a6b222f..01a0dd6 100644
--- a/Apache-IoTDB-Client-CSharp-UserCase/Apache-IoTDB-Client-CSharp-UserCase.csproj
+++ b/Apache-IoTDB-Client-CSharp-UserCase/Apache-IoTDB-Client-CSharp-UserCase.csproj
@@ -1,4 +1,4 @@
-
+
Exe
@@ -8,7 +8,7 @@
-
+
-
+
\ No newline at end of file
diff --git a/Apache-IoTDB-Client-CSharp-UserCase/Program.cs b/Apache-IoTDB-Client-CSharp-UserCase/Program.cs
index 345e9a7..86bea34 100644
--- a/Apache-IoTDB-Client-CSharp-UserCase/Program.cs
+++ b/Apache-IoTDB-Client-CSharp-UserCase/Program.cs
@@ -19,7 +19,6 @@
using System;
using System.Collections.Generic;
-using System.Threading;
using System.Threading.Tasks;
using Apache.IoTDB;
using Apache.IoTDB.DataStructure;
@@ -32,10 +31,19 @@ class Program
static int port = 6667;
static int pool_size = 2;
+ static SessionPool CreateSessionPool()
+ {
+ return new SessionPool.Builder()
+ .SetHost(host)
+ .SetPort(port)
+ .SetPoolSize(pool_size)
+ .Build();
+ }
+
static async Task OpenAndCloseSessionPool()
{
- var session_pool = new SessionPool(host, port, pool_size);
+ var session_pool = CreateSessionPool();
await session_pool.Open(false);
if (session_pool.IsOpen())
{
@@ -50,7 +58,7 @@ static async Task OpenAndCloseSessionPool()
static async Task CreateTimeseries()
{
- var session_pool = new SessionPool(host, port, pool_size);
+ var session_pool = CreateSessionPool();
await session_pool.Open(false);
await session_pool.DeleteDatabaseAsync("root.ln.wf01.wt01");
@@ -63,12 +71,13 @@ static async Task CreateTimeseries()
static async Task InsertRecord()
{
- var session_pool = new SessionPool(host, port, pool_size);
+ var session_pool = CreateSessionPool();
await session_pool.Open(false);
long timestamp = 1;
var values = new List