mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-11-08 10:24:55 +08:00
Update Core
This commit is contained in:
@@ -311,7 +311,8 @@ namespace SqlSugar
|
||||
sqlCommand.Parameters.Clear();
|
||||
ExecuteAfter(sql, parameters);
|
||||
SetConnectionEnd(sql);
|
||||
//sqlCommand.Dispose();
|
||||
if (this.Context.CurrentConnectionConfig.DbType == DbType.Sqlite)
|
||||
sqlCommand.Dispose();
|
||||
return sqlDataReader;
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -445,7 +446,8 @@ namespace SqlSugar
|
||||
sqlCommand.Parameters.Clear();
|
||||
ExecuteAfter(sql, parameters);
|
||||
SetConnectionEnd(sql);
|
||||
//sqlCommand.Dispose();
|
||||
if (this.Context.CurrentConnectionConfig.DbType == DbType.Sqlite)
|
||||
sqlCommand.Dispose();
|
||||
return sqlDataReader;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -191,16 +191,28 @@ namespace SqlSugar
|
||||
|
||||
public IDeleteable<T> Where(string whereString, SugarParameter parameter)
|
||||
{
|
||||
if (DeleteBuilder.Parameters == null)
|
||||
{
|
||||
DeleteBuilder.Parameters = new List<SugarParameter>();
|
||||
}
|
||||
DeleteBuilder.Parameters.Add(parameter);
|
||||
return this;
|
||||
}
|
||||
public IDeleteable<T> Where(string whereString, SugarParameter[] parameters)
|
||||
{
|
||||
if (DeleteBuilder.Parameters == null)
|
||||
{
|
||||
DeleteBuilder.Parameters = new List<SugarParameter>();
|
||||
}
|
||||
DeleteBuilder.Parameters.AddRange(parameters);
|
||||
return this;
|
||||
}
|
||||
public IDeleteable<T> Where(string whereString, List<SugarParameter> parameters)
|
||||
{
|
||||
if (DeleteBuilder.Parameters == null)
|
||||
{
|
||||
DeleteBuilder.Parameters = new List<SugarParameter>();
|
||||
}
|
||||
DeleteBuilder.Parameters.AddRange(parameters);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -965,7 +965,12 @@ namespace SqlSugar
|
||||
addParameters.Add(parameter);
|
||||
}
|
||||
parsmeters.AddRange(addParameters);
|
||||
itemSql = itemSql.TrimEnd(';')+";";
|
||||
itemSql = itemSql
|
||||
.TrimEnd('\r')
|
||||
.TrimEnd('\n')
|
||||
.TrimEnd('\r')
|
||||
.TrimEnd('\n')
|
||||
.TrimEnd(';')+";";
|
||||
sqlBuilder.AppendLine(itemSql);
|
||||
index++;
|
||||
}
|
||||
|
||||
@@ -15,12 +15,12 @@ namespace SqlSugar
|
||||
IDbFirst SettingNamespaceTemplate(Func<string, string> func);
|
||||
RazorFirst UseRazorAnalysis(string razorClassString, string classNamespace = "Models");
|
||||
IDbFirst IsCreateAttribute(bool isCreateAttribute = true);
|
||||
IDbFirst IsCreateDefaultValue(bool isCreateDefaultValue=true);
|
||||
IDbFirst IsCreateDefaultValue(bool isCreateDefaultValue = true);
|
||||
IDbFirst Where(params string[] objectNames);
|
||||
IDbFirst Where(Func<string,bool> func);
|
||||
IDbFirst Where(Func<string, bool> func);
|
||||
IDbFirst WhereColumns(Func<string, bool> func);
|
||||
IDbFirst Where(DbObjectType dbObjectType);
|
||||
void CreateClassFile(string directoryPath, string nameSpace = "Models");
|
||||
void CreateClassFile(string directoryPath, string nameSpace = "Models");
|
||||
Dictionary<string, string> ToClassStringList(string nameSpace = "Models");
|
||||
void Init();
|
||||
}
|
||||
|
||||
@@ -10,6 +10,10 @@ namespace SqlSugar
|
||||
{
|
||||
int reval = 0;
|
||||
if (thisValue == null) return 0;
|
||||
if (thisValue is Enum)
|
||||
{
|
||||
return (int)thisValue;
|
||||
}
|
||||
if (thisValue != null && thisValue != DBNull.Value && int.TryParse(thisValue.ToString(), out reval))
|
||||
{
|
||||
return reval;
|
||||
@@ -20,6 +24,10 @@ namespace SqlSugar
|
||||
public static int ObjToInt(this object thisValue, int errorValue)
|
||||
{
|
||||
int reval = 0;
|
||||
if (thisValue is Enum)
|
||||
{
|
||||
return (int)thisValue;
|
||||
}
|
||||
if (thisValue != null && thisValue != DBNull.Value && int.TryParse(thisValue.ToString(), out reval))
|
||||
{
|
||||
return reval;
|
||||
|
||||
Reference in New Issue
Block a user