This commit is contained in:
sunkaixuan 2017-05-16 14:00:51 +08:00
parent 9562e71cfa
commit a59d8cb6e3
2 changed files with 9 additions and 1 deletions

View File

@ -105,7 +105,14 @@ namespace SqlSugar
} }
return this; return this;
} }
public IDeleteable<T> In<PkType>(List<PkType> primaryKeyValues) {
if (primaryKeyValues == null || primaryKeyValues.Count() == 0)
{
Where("1=2 ");
return this;
}
return In<PkType>(primaryKeyValues.ToArray());
}
public IDeleteable<T> In<PkType>(PkType[] primaryKeyValues) public IDeleteable<T> In<PkType>(PkType[] primaryKeyValues)
{ {
if (primaryKeyValues == null || primaryKeyValues.Count() == 0) if (primaryKeyValues == null || primaryKeyValues.Count() == 0)

View File

@ -16,6 +16,7 @@ namespace SqlSugar
IDeleteable<T> Where(List<T> deleteObjs); IDeleteable<T> Where(List<T> deleteObjs);
IDeleteable<T> In<PkType>(PkType primaryKeyValue); IDeleteable<T> In<PkType>(PkType primaryKeyValue);
IDeleteable<T> In<PkType>(PkType[] primaryKeyValues); IDeleteable<T> In<PkType>(PkType[] primaryKeyValues);
IDeleteable<T> In<PkType>(List<PkType> primaryKeyValues);
IDeleteable<T> Where(string whereString,object whereObj=null); IDeleteable<T> Where(string whereString,object whereObj=null);
KeyValuePair<string, List<SugarParameter>> ToSql(); KeyValuePair<string, List<SugarParameter>> ToSql();
} }