public void Insert(ICollection <T> entities) { using (DbConnection conn = _DataBase.CreateConnection()) { conn.ConnectionString = _strConn; // conn.Open(); if (conn.GetType() == typeof(SqlConnection)) { SqlMap <T> .SqlBulkInsert(entities, (SqlConnection)conn); } else { SqlMap <T> .Insert(entities, conn, _DataBase); } } }