mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-26 02:39:14 +08:00
Add SqlFunc.Coalesce
This commit is contained in:
@@ -1200,7 +1200,12 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
return $" uuid_generate_v4() ";
|
return $" uuid_generate_v4() ";
|
||||||
}
|
}
|
||||||
|
public virtual string Coalesce(MethodCallExpressionModel mode)
|
||||||
|
{
|
||||||
|
var parameterNameA = mode.Args[0].MemberName;
|
||||||
|
var parameterNameB = mode.Args[1].MemberName;
|
||||||
|
return $" COALESCE({parameterNameA},{parameterNameB}) ";
|
||||||
|
}
|
||||||
public virtual string FullTextContains(MethodCallExpressionModel mode)
|
public virtual string FullTextContains(MethodCallExpressionModel mode)
|
||||||
{
|
{
|
||||||
var columns = mode.Args[0].MemberName;
|
var columns = mode.Args[0].MemberName;
|
||||||
|
|||||||
@@ -130,5 +130,6 @@ namespace SqlSugar
|
|||||||
string FullTextContains(MethodCallExpressionModel mode);
|
string FullTextContains(MethodCallExpressionModel mode);
|
||||||
string PgsqlArrayContains(MethodCallExpressionModel model);
|
string PgsqlArrayContains(MethodCallExpressionModel model);
|
||||||
string SelectFields(MethodCallExpressionModel model);
|
string SelectFields(MethodCallExpressionModel model);
|
||||||
|
string Coalesce(MethodCallExpressionModel model);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,11 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
public partial class SqlFunc
|
public partial class SqlFunc
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public static T Coalesce<T>(T value1, T value2)
|
||||||
|
{
|
||||||
|
throw new NotSupportedException("Can only be used in expressions");
|
||||||
|
}
|
||||||
public static bool FullTextContains(string [] columnNames, string keyword)
|
public static bool FullTextContains(string [] columnNames, string keyword)
|
||||||
{
|
{
|
||||||
throw new NotSupportedException("Can only be used in expressions");
|
throw new NotSupportedException("Can only be used in expressions");
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<package >
|
<package >
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>SqlSugarCore</id>
|
<id>SqlSugarCore</id>
|
||||||
<version>5.1.4.176-preview08</version>
|
<version>5.1.4.176-preview15</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>
|
||||||
|
|||||||
Reference in New Issue
Block a user