Synchronization code

This commit is contained in:
sunkaixuan 2023-09-25 13:03:41 +08:00
parent 8817cce667
commit 9ddfd4eedd
2 changed files with 16 additions and 0 deletions

View File

@ -4,6 +4,18 @@
{
public override ISugarQueryable<T> With(string withString)
{
if (withString == null)
{
return this;
}
if (UtilMethods.StringCheckFirstAndLast(withString.TrimStart(' ').TrimEnd(' '), "/*", "*/"))
{
QueryBuilder.TableWithString = withString;
}
else if (UtilMethods.StringCheckFirstAndLast(withString.TrimStart(' ').TrimEnd(' ').ToLower(), "force", ")"))
{
QueryBuilder.TableWithString = withString;
}
return this;
}

View File

@ -18,6 +18,10 @@ namespace SqlSugar
{
public class UtilMethods
{
public static bool StringCheckFirstAndLast(string withString, string first, string last)
{
return withString.StartsWith(first) && withString.EndsWith(last);
}
public static bool HasInterface(Type targetType, Type interfaceType)
{
if (targetType == null || interfaceType == null || !interfaceType.IsInterface)