Update dynamic where

This commit is contained in:
sunkaixuan
2023-11-23 13:17:52 +08:00
parent 7c2447ce26
commit 7baf2bfa3b

View File

@@ -952,6 +952,11 @@ namespace SqlSugar
} }
public virtual ISugarQueryable<T> Where(string expShortName, FormattableString expressionString) public virtual ISugarQueryable<T> Where(string expShortName, FormattableString expressionString)
{ {
if (expressionString == null&& !Regex.IsMatch(expShortName,@"^\w$"))
{
return this.Where(expShortName, new { });
}
var exp = DynamicCoreHelper.GetWhere<T>(expShortName, expressionString); var exp = DynamicCoreHelper.GetWhere<T>(expShortName, expressionString);
_Where(exp); _Where(exp);
return this; return this;