public static void BulkInsert <T>(this TdsConnectionPool tdsConnectionPool, IEnumerable <T> objects, string tableName, Dictionary <string, PropertyInfo> columnMapping) { var cnn = tdsConnectionPool.GetConnection(); cnn.BulkInsert(objects, tableName, columnMapping); tdsConnectionPool.Return(cnn); }
public static void BulkInsert <T>(this TdsConnectionPool tdsConnectionPool, IEnumerable <T> objects, string tableName) { var cnn = tdsConnectionPool.GetConnection(); cnn.BulkInsert(objects, tableName); tdsConnectionPool.Return(cnn); }
public static void ExecuteNonQuery(this TdsConnectionPool tdsConnectionPool, string text) { var cnn = tdsConnectionPool.GetConnection(); cnn.ExecuteNonQuery(text); tdsConnectionPool.Return(cnn); }
public static List <T> ExecuteParameterQuery <T>(this TdsConnectionPool tdsConnectionPool, FormattableString text) where T : class, new() { var cnn = tdsConnectionPool.GetConnection(); var result = cnn.ExecuteParameterQuery <T>(text); tdsConnectionPool.Return(cnn); return(result); }
public MedellaOrm() { var connections = new TdsConnection[conc]; _tds = TdsConnectionPools.GetConnectionPool(_connectionString); var task = Parallel.For(0, conc, (x) => connections[x] = _tds.GetConnection()); //OrmTester.EnsureDbSetup(_connectionString); task = Parallel.For(0, conc, (x) => _tds.Return(connections[x])); }