mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 13:06:50 +08:00
Update QueryableByObject.As
This commit is contained in:
parent
a324c353a3
commit
a0c648f4cc
@ -4,6 +4,7 @@ using System.Data;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
@ -30,6 +31,10 @@ namespace SqlSugar
|
||||
public QueryMethodInfo AS(string tableName)
|
||||
{
|
||||
string shortName = $"{tableName}_1";
|
||||
if (!Regex.IsMatch(shortName, @"^\w+$"))
|
||||
{
|
||||
shortName = "maintable";
|
||||
}
|
||||
var method = QueryableObj.GetType().GetMyMethod("AS", 2, typeof(string), typeof(string));
|
||||
this.QueryableObj = method.Invoke(QueryableObj, new object[] { tableName, shortName });
|
||||
return this;
|
||||
|
Loading…
Reference in New Issue
Block a user