Example #1
0
        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);
        }
Example #2
0
        public static void BulkInsert <T>(this TdsConnectionPool tdsConnectionPool, IEnumerable <T> objects, string tableName)
        {
            var cnn = tdsConnectionPool.GetConnection();

            cnn.BulkInsert(objects, tableName);
            tdsConnectionPool.Return(cnn);
        }
Example #3
0
        public static void ExecuteNonQuery(this TdsConnectionPool tdsConnectionPool, string text)
        {
            var cnn = tdsConnectionPool.GetConnection();

            cnn.ExecuteNonQuery(text);
            tdsConnectionPool.Return(cnn);
        }
Example #4
0
        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);
        }
Example #5
0
        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]));
        }