Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update语句,二元运算解析出错 #184

Closed
LiaoLiaoWuJu opened this issue Jan 16, 2020 · 5 comments
Closed

update语句,二元运算解析出错 #184

LiaoLiaoWuJu opened this issue Jan 16, 2020 · 5 comments

Comments

@LiaoLiaoWuJu
Copy link

` var now = DateTime.Now;
short notstarted = (short)ExaminationState.NotStarted, ongoing = (short)ExaminationState.Ongoing, finished = (short)ExaminationState.Finished;

fsql.Update().Set(it => it.StateId == (it.EndTime < now ? finished : ongoing)).Where(it => it.StateId == notstarted && it.StartTime <= now).ExecuteAffrows();
`
解析出错QQ图片20200116145708

@pjy612
Copy link

pjy612 commented Jan 16, 2020

这种应该不支持这么写吧?
先 ToSql 试试 看看生成的语句是啥?

@LiaoLiaoWuJu
Copy link
Author

这种应该不支持这么写吧?
先 ToSql 试试 看看生成的语句是啥?

支持这种写法,解析出错,没办法ToSql的。

@pjy612
Copy link

pjy612 commented Jan 16, 2020

这种应该不支持这么写吧?
先 ToSql 试试 看看生成的语句是啥?

支持这种写法,解析出错,没办法ToSql的。

说的是 这种解析不支持 = =。你要不要试试包一个自定义解析试试?
或者先全部查出来 再改完 SetSource Update 回去。

@LiaoLiaoWuJu
Copy link
Author

这种应该不支持这么写吧?
先 ToSql 试试 看看生成的语句是啥?

支持这种写法,解析出错,没办法ToSql的。

说的是 这种解析不支持 = =。你要不要试试包一个自定义解析试试?
或者先全部查出来 再改完 SetSource Update 回去。

已经换回原来写的方法
fsql.Update().Set(it => new Examination { StateId = (it.EndTime < now ? finished : ongoing) }).Where(it => it.StateId == notstarted && it.StartTime <= now).ExecuteAffrows();
等叶老板调整

2881099 pushed a commit that referenced this issue Jan 19, 2020
- 修复 .ToList(a => new DTO(a.id)) 报 未将对象引用设置到对象的实例 问题; #187
- 修复 update语句,二元运算解析出错; #184
@2881099
Copy link
Collaborator

2881099 commented Jan 19, 2020

原因是与 MapType 处理冲突,现在是分开解决的

2881099 pushed a commit that referenced this issue Jan 19, 2020
2881099 pushed a commit that referenced this issue Mar 31, 2020
- 修复 FreeSql.Provider.MySqlConnector Enum 自定义元素值,导致值计算错误的 bug;
2881099 pushed a commit that referenced this issue Mar 31, 2020
@2881099 2881099 closed this as completed May 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants