mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 10:42:52 +08:00
- 修复 表达式 Not 位运算符解析错误;#340
This commit is contained in:
parent
b9948f4508
commit
f4ffcfff7c
@ -306,6 +306,7 @@ namespace FreeSql.Tests.Dameng
|
|||||||
[Fact]
|
[Fact]
|
||||||
public void CurdAllField()
|
public void CurdAllField()
|
||||||
{
|
{
|
||||||
|
g.dameng.Delete<TableAllType>().Where("1=1").ExecuteAffrows();
|
||||||
var item2 = new TableAllType
|
var item2 = new TableAllType
|
||||||
{
|
{
|
||||||
Bool = true,
|
Bool = true,
|
||||||
|
@ -155,6 +155,10 @@ namespace FreeSql.Tests
|
|||||||
[Fact]
|
[Fact]
|
||||||
public void Test03()
|
public void Test03()
|
||||||
{
|
{
|
||||||
|
var tttrule = 8;
|
||||||
|
var tttid = new long[] { 18, 19, 4017 };
|
||||||
|
g.sqlserver.Update<Author123>().Set(it => it.SongId == (short)(it.SongId & ~tttrule)).Where(it => (it.SongId & tttrule) == tttrule && !tttid.Contains(it.Id)).ExecuteAffrows();
|
||||||
|
|
||||||
g.sqlite.Delete<Song123>().Where("1=1").ExecuteAffrows();
|
g.sqlite.Delete<Song123>().Where("1=1").ExecuteAffrows();
|
||||||
g.sqlite.Delete<Author123>().Where("1=1").ExecuteAffrows();
|
g.sqlite.Delete<Author123>().Where("1=1").ExecuteAffrows();
|
||||||
g.sqlite.Insert(new Song123(1)).ExecuteAffrows();
|
g.sqlite.Insert(new Song123(1)).ExecuteAffrows();
|
||||||
|
@ -580,6 +580,7 @@ namespace FreeSql.Internal
|
|||||||
{
|
{
|
||||||
case ExpressionType.Not:
|
case ExpressionType.Not:
|
||||||
var notExp = (exp as UnaryExpression)?.Operand;
|
var notExp = (exp as UnaryExpression)?.Operand;
|
||||||
|
if (notExp.Type.IsNumberType()) return $"~{ExpressionLambdaToSql(notExp, tsc)}"; //位操作
|
||||||
if (notExp.NodeType == ExpressionType.MemberAccess)
|
if (notExp.NodeType == ExpressionType.MemberAccess)
|
||||||
{
|
{
|
||||||
var notBody = ExpressionLambdaToSql(notExp, tsc);
|
var notBody = ExpressionLambdaToSql(notExp, tsc);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user