mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Update Core
This commit is contained in:
parent
471beeecb1
commit
121e4690b3
@ -41,11 +41,11 @@ namespace SqlSugar
|
||||
{
|
||||
if (AsName == null)
|
||||
{
|
||||
return queryable.Where(it => false).ToDataTable();
|
||||
return queryable.Where(it => false).Select("*").ToDataTable();
|
||||
}
|
||||
else
|
||||
{
|
||||
return queryable.AS(AsName).Where(it => false).ToDataTable();
|
||||
return queryable.AS(AsName).Where(it => false).Select("*").ToDataTable();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
@ -41,11 +41,11 @@ namespace SqlSugar
|
||||
{
|
||||
if (AsName == null)
|
||||
{
|
||||
return queryable.Where(it => false).ToDataTable();
|
||||
return queryable.Where(it => false).Select("*").ToDataTable();
|
||||
}
|
||||
else
|
||||
{
|
||||
return queryable.AS(AsName).Where(it => false).ToDataTable();
|
||||
return queryable.AS(AsName).Where(it => false).Select("*").ToDataTable();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Oracle.ManagedDataAccess.Client;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
@ -8,9 +9,43 @@ namespace SqlSugar
|
||||
{
|
||||
public class OracleFastBuilder : FastBuilder, IFastBuilder
|
||||
{
|
||||
private OracleBulkCopy GetBulkCopyInstance()
|
||||
|
||||
{
|
||||
if (this.Context.Ado.Connection.State == ConnectionState.Closed)
|
||||
{
|
||||
this.Context.Ado.Connection.Open();
|
||||
}
|
||||
|
||||
OracleBulkCopy copy;
|
||||
if (this.Context.Ado.Transaction == null)
|
||||
{
|
||||
copy = new OracleBulkCopy((OracleConnection)this.Context.Ado.Connection, Oracle.ManagedDataAccess.Client.OracleBulkCopyOptions.Default);
|
||||
}
|
||||
else
|
||||
{
|
||||
copy = new OracleBulkCopy((OracleConnection)this.Context.Ado.Connection, OracleBulkCopyOptions.UseInternalTransaction);
|
||||
}
|
||||
return copy;
|
||||
|
||||
}
|
||||
public Task<int> ExecuteBulkCopyAsync(DataTable dt)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
OracleBulkCopy copy = GetBulkCopyInstance();
|
||||
try
|
||||
{
|
||||
copy.DestinationTableName = dt.TableName;
|
||||
copy.WriteToServer(dt);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseDb();
|
||||
}
|
||||
return Task.FromResult(dt.Rows.Count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user