mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-15 18:55:07 +08:00
Synchronization code
This commit is contained in:
@@ -922,6 +922,20 @@ namespace SqlSugar
|
||||
var result = SqlQuery<T, object, object, object, object, object, object>(sql, parameters);
|
||||
return result.Item1;
|
||||
}
|
||||
public List<T> MasterSqlQuery<T>(string sql, object parameters = null)
|
||||
{
|
||||
var oldValue = this.Context.Ado.IsDisableMasterSlaveSeparation;
|
||||
this.Context.Ado.IsDisableMasterSlaveSeparation = true;
|
||||
var result = this.Context.Ado.SqlQuery<T>(sql, parameters);
|
||||
return result;
|
||||
}
|
||||
public async Task<List<T>> MasterSqlQueryAasync<T>(string sql, object parameters = null)
|
||||
{
|
||||
var oldValue = this.Context.Ado.IsDisableMasterSlaveSeparation;
|
||||
this.Context.Ado.IsDisableMasterSlaveSeparation = true;
|
||||
var result = await this.Context.Ado.SqlQueryAsync<T>(sql, parameters);
|
||||
return result;
|
||||
}
|
||||
public virtual List<T> SqlQuery<T>(string sql, List<SugarParameter> parameters)
|
||||
{
|
||||
if (parameters != null)
|
||||
|
@@ -71,6 +71,10 @@ namespace SqlSugar.DistributedSystem.Snowflake
|
||||
}
|
||||
public virtual long NextId()
|
||||
{
|
||||
if (StaticConfig.CustomSnowFlakeFunc != null)
|
||||
{
|
||||
return StaticConfig.CustomSnowFlakeFunc();
|
||||
}
|
||||
lock(_lock)
|
||||
{
|
||||
var timestamp = TimeGen();
|
||||
|
@@ -9,5 +9,6 @@ namespace SqlSugar
|
||||
public static Func<string,string> Encode { get; set; }
|
||||
public static Func<string,string> Decode{ get; set; }
|
||||
public const string CodeFirst_BigString = "varcharmax,longtext,text,clob";
|
||||
public static Func<long> CustomSnowFlakeFunc;
|
||||
}
|
||||
}
|
||||
|
@@ -147,6 +147,8 @@ namespace SqlSugar
|
||||
List<T> SqlQuery<T>(string sql, object parameters = null);
|
||||
List<T> SqlQuery<T>(string sql, params SugarParameter[] parameters);
|
||||
List<T> SqlQuery<T>(string sql, List<SugarParameter> parameters);
|
||||
Task<List<T>> MasterSqlQueryAasync<T>(string sql, object parameters = null);
|
||||
List<T> MasterSqlQuery<T>(string sql, object parameters = null);
|
||||
|
||||
Task<List<T>> SqlQueryAsync<T>(string sql, object parameters = null);
|
||||
Task<List<T>> SqlQueryAsync<T>(string sql, List<SugarParameter> parameters);
|
||||
|
Reference in New Issue
Block a user