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

where Lambda 属性类型为 Guid 时不能执行 #28

Closed
sangeren opened this issue Apr 4, 2019 · 11 comments
Closed

where Lambda 属性类型为 Guid 时不能执行 #28

sangeren opened this issue Apr 4, 2019 · 11 comments

Comments

@sangeren
Copy link

sangeren commented Apr 4, 2019

提示不支持的表达式,我想知道 为什么不支持guid类型,同字符串一样实现有问题吗?

然后还有一个问题,我使用mysql数据库,打包时打了一堆别的数据库dll,能不能不同数据库独立发包?

@2881099
Copy link
Collaborator

2881099 commented Apr 4, 2019

问题1 where怎么写的

问题2 你应该用的是netframework?由于是netstandard库,是会比较多小包。未来是这个趋势,按数据库拆分其实不会少几个dll。

@sangeren
Copy link
Author

sangeren commented Apr 4, 2019

await _postCategoryRepository.Select.Where(p => p.ParentId.Equals(Guid.Empty)).ToListAsync();

@2881099
Copy link
Collaborator

2881099 commented Apr 4, 2019

https://github.com/2881099/FreeSql/wiki/%E8%A1%A8%E8%BE%BE%E5%BC%8F%E5%87%BD%E6%95%B0
这里是表达式解析的列表

可以直接用 = 判断,equals没支持,回头我支持一下,谢谢提醒

@sangeren
Copy link
Author

sangeren commented Apr 4, 2019

“然后还有一个问题,我使用mysql数据库,打包时打了一堆别的数据库dll,”

这个问题是样的,我部署到docker中,每次 restore project 时会去拉所有引用的包,
那天网不好,每次都是断在 freesql的还原,然后我看了它引用了一些别的数据库dll,所以我有了这个想法。

@sangeren
Copy link
Author

sangeren commented Apr 4, 2019

.Where("ParentId = ?ParentId", new { ParentId = Guid.Empty })

这是我之前找到方式,不知道你说的是这个意思不。

@2881099
Copy link
Collaborator

2881099 commented Apr 4, 2019

了解了,看来还是得拆。

不过到时候会暴露一些,对外部没多少意义的方法和类。

2881099 added a commit that referenced this issue Apr 4, 2019
@2881099
Copy link
Collaborator

2881099 commented Apr 4, 2019

.Where("ParentId = ?ParentId", new { ParentId = Guid.Empty })

这是我之前找到方式,不知道你说的是这个意思不。

这种也可以,我说的是 .Where(p => p.ParentId == Guid.Empty)

@2881099
Copy link
Collaborator

2881099 commented Apr 4, 2019

我现在把 Equals 改成和 == 一样的行为了。

当右表达式值为 NULL 时,会变为 ParentId is null

@2881099
Copy link
Collaborator

2881099 commented Apr 4, 2019

is null, is not nul 这个行为之前就有

@2881099
Copy link
Collaborator

2881099 commented Apr 4, 2019

image

谢谢你的提醒

2881099 pushed a commit that referenced this issue Apr 9, 2019
- 修复 pgsql Enum 类型 formatSql bug;
- 补充 表达式解析 Equals 为 = #28 #29
@2881099
Copy link
Collaborator

2881099 commented May 29, 2019

#55
现在按小包拆分发布了,谢谢

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

2 participants