Q:

Entify Framework BulkInsert

What the best way to bulk inserts a large number of different types of records using UnitOfWork pattern with Entity Framework. I also need to invert back if an error is thrown or something. 
I got it working fine using "SqlBulkCopy" but when I wrap this into a transactionscope, I get an error about the connection it is already open using the UnitOfWork. 
I can not use EntityFramework.Extensions since it is not open-source. 

Edit - adding Unit Of Work:

Basically, I follow this example: click here
here is my concrete class for unit of work:
    public class UnitOfWork<TContext> : Disposable, IUnitOfWork<TContext> where TContext : DbContext, new()
    {

        private  DbContext _context;
        private bool _disposed;

        private IGenericRepository<Log> _logRepository;

        // other generic repositories

        public UnitOfWork()
        {
            _context = new TContext();
        }

        public IGenericRepository<Log> LogRepository 
            => _logRepository ?? (_logRepository = new GenericRepository<Log>(_context));

        //getters for other repositories

        //------------Public Function --------------------------------
        public void Save()
        {
            _context.SaveChanges();
        }
        // this is the bulkInsert using SqlBulkCopy 
        //but getting error on the transactionscope due to opening a new connection
        public virtual void BulkInsert<T>(DbContextTransaction tx, string tableName, System.Data.DataTable dataTable)
        {
            if (!Regex.IsMatch(dataTable.TableName, @"^[A-Za-z0-9\._]+$"))
            {
                return;
            }

            SqlTransaction sqlTx = (SqlTransaction)tx?.UnderlyingTransaction;

            var columnNames =
                _context.Database.SqlQuery<SysColumns>("SELECT c.Name, t.name as Type FROM sys.columns c JOIN sys.types t ON c.user_type_id = t.user_type_id WHERE object_id = OBJECT_ID('" + dataTable.TableName + "')");

            if (columnNames == null)
            {
                return;
            }

            var connectionString = _context.Database.Connection.ConnectionString;
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                connection.Open();
                using (SqlBulkCopy bulkCopy = new SqlBulkCopy(connection, SqlBulkCopyOptions.Default, sqlTx))
                {
                    bulkCopy.DestinationTableName = tableName;
                    bulkCopy.BulkCopyTimeout = (int) TimeSpan.FromMinutes(10).TotalSeconds;

                    foreach (var column in dataTable.Columns)
                    {
                        var dbColumn =
                                columnNames.FirstOrDefault(x => string.Equals(x.Name, column.ToString(), StringComparison.CurrentCultureIgnoreCase));

                        if (dbColumn != null)
                        {
                            bulkCopy.ColumnMappings.Add(column.ToString(), dbColumn.Name);
                        }
                    }

                    bulkCopy.WriteToServer(dataTable);
                }
                connection.Close();
            }
        }

        private void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                if (disposing)
                {
                    _context.Dispose();
                }
            }
            _disposed = true;
        }

        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

    }
}

Edit - Add More code:

    public void ProcessData()
    {

        using (var transaction = new TransactionScope())
        {
            try
            {
                _repository.LogRepository.Insert(//log to initial import data)

                ImportData(); 

               _repository.LogRepository.Insert(//log to Complete import data)
                _repository.Save();                   
            }
            catch (Exception e)
            {
                transaction.Dispose();

            }
        }
    }

     private void ImportData()
    {
        //Creating object of datatable  
        var tblcsv =
            new DataTable("dbo.Table") { CaseSensitive = false };

        //getting full file path of Uploaded file  
        var csvFilePath = _dataImportModel.RootPath + "\\Collector\\" + "data.csv";

        //Reading All text  
        var readCsv = File.ReadAllText(csvFilePath);

        foreach (var csvRow in readCsv.Split('\n'))
        {
                foreach (var fileColumn in csvRow.Split(','))
                {
                    tblcsv.Columns.Add(fileColumn);
                }
                break;

        }

        //spliting row after new line  
        var rows = readCsv.Split('\n');
        foreach (var csvRow in rows)
        {
            if (!string.IsNullOrEmpty(csvRow))
            {

                var count = 0;
                var columnsData = SplitCsv(csvRow);

                    //Adding each row into datatable  
                    tblcsv.Rows.Add();
                    foreach (var fileRec in columnsData)
                    {
                        tblcsv.Rows[tblcsv.Rows.Count - 1][count] =
                            string.IsNullOrEmpty(fileRec) ? null : fileRec;
                        count++;
                    }

            }
        }

        _repository.BulkInsert<DataTable>(null,  "dbo.Table", tblcsv);
    }

A:

I looked at inner exception, error message is "The partner transaction manager has disabled its support for remote/network transactions. (Exception from HRESULT: 0x8004D025)

There is a lot of possible causes why this issue can happen.
By example, opening a connection than another connection without closing the first one can lead tot this kind of error:
using (var context = new CurrentContext())
{
    using (var scope = new TransactionScope())
    {
        context.Database.Connection.Open();
        using (var connection = new SqlConnection(context.Database.Connection.ConnectionString))
        {
            connection.Open();
            using (var command = new SqlCommand("SELECT 1", connection))
            {
                var x = command.ExecuteNonQuery();
            }
        }

    }      
}

