Deletion Page deletion is supported

This commit is contained in:
sunkaixuan 2023-09-06 14:16:29 +08:00
parent 9270ab78f5
commit 23d4b00037
2 changed files with 11 additions and 0 deletions

View File

@ -516,6 +516,15 @@ namespace SqlSugar
tempPrimaryKeys = null;
return this;
}
public IDeleteable<T> In<PkType>(Expression<Func<T, object>> inField, ISugarQueryable<PkType> childQueryExpression)
{
var lamResult = DeleteBuilder.GetExpressionValue(inField, ResolveExpressType.FieldSingle);
var fieldName = lamResult.GetResultString();
var sql= childQueryExpression.ToSql();
Where($" {fieldName} IN ( {sql.Key} ) ",sql.Value);
return this;
}
public IDeleteable<T> In<PkType>(string inField, List<PkType> primaryKeyValues)
{
tempPrimaryKeys = new List<string>() { inField };

View File

@ -29,6 +29,8 @@ namespace SqlSugar
IDeleteable<T> In<PkType>(Expression<Func<T,object>> inField,PkType primaryKeyValue);
IDeleteable<T> In<PkType>(Expression<Func<T, object>> inField,PkType[] primaryKeyValues);
IDeleteable<T> In<PkType>(Expression<Func<T, object>> inField,List<PkType> primaryKeyValues);
IDeleteable<T> In<PkType>(Expression<Func<T, object>> inField, ISugarQueryable<PkType> childQueryExpression);
IDeleteable<T> In<PkType>(string inField, List<PkType> primaryKeyValues);
IDeleteable<T> Where(string whereString,object parameters=null);
IDeleteable<T> Where(string whereString, SugarParameter parameter);