mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Add IUpdateable<T> Where(string fieldName,string conditionalType, object fieldValue)
This commit is contained in:
parent
5c27d8babb
commit
98ba051d16
@ -61,7 +61,7 @@ namespace OrmTest.Demo
|
||||
|
||||
//sql
|
||||
db.Updateable(updateObj).Where("id=@x",new { x="1"}).ExecuteCommand();
|
||||
|
||||
db.Updateable(updateObj).Where("id","=",1).ExecuteCommand();
|
||||
var t12 = db.Updateable<School>().AS("Student").UpdateColumns(it => new School() { Name = "jack" }).Where(it => it.Id == 1).ExecuteCommandAsync();
|
||||
t12.Wait();
|
||||
|
||||
|
@ -207,6 +207,15 @@ namespace SqlSugar
|
||||
return this;
|
||||
}
|
||||
|
||||
public IUpdateable<T> Where(string fieldName,string conditionalType, object fieldValue)
|
||||
{
|
||||
var whereSql=this.SqlBuilder.GetWhere(fieldName, conditionalType,0);
|
||||
this.Where(whereSql);
|
||||
string parameterName = this.SqlBuilder.SqlParameterKeyWord + fieldName+ "0";
|
||||
this.UpdateBuilder.Parameters.Add(new SugarParameter(parameterName, fieldValue));
|
||||
return this;
|
||||
}
|
||||
|
||||
public IUpdateable<T> With(string lockString)
|
||||
{
|
||||
if (this.Context.CurrentConnectionConfig.DbType == DbType.SqlServer)
|
||||
|
@ -20,6 +20,14 @@ namespace SqlSugar
|
||||
IUpdateable<T> Where(Expression<Func<T, bool>> expression);
|
||||
IUpdateable<T> Where(string whereSql,object parameters=null);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="fieldName"></param>
|
||||
/// <param name="conditionalType">for example : = </param>
|
||||
/// <param name="fieldValue"></param>
|
||||
/// <returns></returns>
|
||||
IUpdateable<T> Where(string fieldName, string conditionalType, object fieldValue);
|
||||
/// <summary>
|
||||
/// Non primary key entity update function
|
||||
/// </summary>
|
||||
/// <param name="columns"></param>
|
||||
|
Loading…
Reference in New Issue
Block a user