mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-12-26 14:15:50 +08:00
code optimization
This commit is contained in:
@@ -460,6 +460,10 @@ namespace SqlSugar
|
||||
|
||||
public virtual T InSingle(object pkValue)
|
||||
{
|
||||
if (pkValue == null)
|
||||
{
|
||||
pkValue = -1;
|
||||
}
|
||||
Check.Exception(this.QueryBuilder.SelectValue.HasValue(), "'InSingle' and' Select' can't be used together,You can use .Select(it=>...).Single(it.id==1)");
|
||||
var list = In(pkValue).ToList();
|
||||
if (list == null) return default(T);
|
||||
|
||||
Reference in New Issue
Block a user