Browse Source

InSingle Bug

pull/12/MERGE
sunkaixuan 7 years ago
parent
commit
0dfc91f96b
  1. 1
      Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs

1
Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs

@ -167,6 +167,7 @@ namespace SqlSugar
public virtual T InSingle(object pkValue)
{
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);
else return list.SingleOrDefault();

Loading…
Cancel
Save