mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-26 20:52:50 +08:00
39 lines
2.0 KiB
C#
39 lines
2.0 KiB
C#
using FreeSql.Internal.CommonProvider;
|
|
using FreeSql.Oracle.Curd;
|
|
using System;
|
|
using System.Data.Common;
|
|
using System.Threading;
|
|
|
|
namespace FreeSql.Oracle
|
|
{
|
|
|
|
public class OracleProvider<TMark> : BaseDbProvider, IFreeSql<TMark>
|
|
{
|
|
public override ISelect<T1> CreateSelectProvider<T1>(object dywhere) => new OracleSelect<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, dywhere);
|
|
public override IInsert<T1> CreateInsertProvider<T1>() => new OracleInsert<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression);
|
|
public override IUpdate<T1> CreateUpdateProvider<T1>(object dywhere) => new OracleUpdate<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, dywhere);
|
|
public override IDelete<T1> CreateDeleteProvider<T1>(object dywhere) => new OracleDelete<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression, dywhere);
|
|
public override IInsertOrUpdate<T1> CreateInsertOrUpdateProvider<T1>() => new OracleInsertOrUpdate<T1>(this, this.InternalCommonUtils, this.InternalCommonExpression);
|
|
|
|
public OracleProvider(string masterConnectionString, string[] slaveConnectionString, Func<DbConnection> connectionFactory = null)
|
|
{
|
|
this.InternalCommonUtils = new OracleUtils(this);
|
|
this.InternalCommonExpression = new OracleExpression(this.InternalCommonUtils);
|
|
|
|
this.Ado = new OracleAdo(this.InternalCommonUtils, masterConnectionString, slaveConnectionString, connectionFactory);
|
|
this.Aop = new AopProvider();
|
|
|
|
this.DbFirst = new OracleDbFirst(this, this.InternalCommonUtils, this.InternalCommonExpression);
|
|
this.CodeFirst = new OracleCodeFirst(this, this.InternalCommonUtils, this.InternalCommonExpression);
|
|
}
|
|
|
|
~OracleProvider() => this.Dispose();
|
|
int _disposeCounter;
|
|
public override void Dispose()
|
|
{
|
|
if (Interlocked.Increment(ref _disposeCounter) != 1) return;
|
|
(this.Ado as AdoProvider)?.Dispose();
|
|
}
|
|
}
|
|
}
|