Linq 2 sql

This commit is contained in:
sunkaixuan
2024-09-19 15:28:20 +08:00
parent c873d24be1
commit 05788a10f2
4 changed files with 26 additions and 1 deletions

View File

@@ -1228,5 +1228,9 @@ namespace SqlSugar
return queryCondition; return queryCondition;
} }
public virtual string SelectFields(MethodCallExpressionModel model)
{
return string.Join(",", model.Args.Select(it => it.MemberName));
}
} }
} }

View File

@@ -128,5 +128,6 @@ namespace SqlSugar
string NewUid(MethodCallExpressionModel mode); string NewUid(MethodCallExpressionModel mode);
string FullTextContains(MethodCallExpressionModel mode); string FullTextContains(MethodCallExpressionModel mode);
string PgsqlArrayContains(MethodCallExpressionModel model); string PgsqlArrayContains(MethodCallExpressionModel model);
string SelectFields(MethodCallExpressionModel model);
} }
} }

View File

@@ -431,5 +431,25 @@ namespace SqlSugar
{ {
throw new NotSupportedException("Can only be used in expressions"); throw new NotSupportedException("Can only be used in expressions");
} }
public static void SelectFields(string fieldName1)
{
throw new NotSupportedException("Can only be used in expressions");
}
public static void SelectFields(string fieldName1,string fieldName2)
{
throw new NotSupportedException("Can only be used in expressions");
}
public static void SelectFields(string fieldName1, string fieldName2, string fieldName3)
{
throw new NotSupportedException("Can only be used in expressions");
}
public static void SelectFields(string fieldName1, string fieldName2, string fieldName3, string fieldName4)
{
throw new NotSupportedException("Can only be used in expressions");
}
public static void SelectFields(string fieldName1, string fieldName2, string fieldName3, string fieldName4, string fieldName5)
{
throw new NotSupportedException("Can only be used in expressions");
}
} }
} }

View File

@@ -2,7 +2,7 @@
<package > <package >
<metadata> <metadata>
<id>SqlSugarCore</id> <id>SqlSugarCore</id>
<version>5.1.4.169</version> <version>5.1.4.170-preview02</version>
<authors>sunkaixuan</authors> <authors>sunkaixuan</authors>
<owners>果糖大数据科技</owners> <owners>果糖大数据科技</owners>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl> <licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>