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

添加InsertOrUpdateDict的Dynamic类型扩展方法 #1784

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hjkl950217
Copy link
Contributor

@hjkl950217 hjkl950217 commented Apr 18, 2024

近期有一个需求,需要从mysql迁移数据到DM, 而且还能能使用多次,还好InsertOrUpdateDict方法解决了我的问题。
Dictionary<string, object>Dynamic理论上能相互转换,我项目里用的多的是Dynamic,背后是ExpandoObject.

顺手就把需要的这个方法扩展出来了

@2881099
Copy link
Collaborator

2881099 commented Apr 18, 2024

感谢贡献,不过由于 dynamic 依赖 Microsoft.xxx.Script 版本会导致依赖冲突

因此默认没有集成这个类型,FreeSql 宗旨是零依赖。

@hjkl950217
Copy link
Contributor Author

是.net框架上的Script版本吗? 我这里是.net6 只引用了FreeSql.Provider.MySql,没有发现你说的这个。
PR里也只是把每个元素,转换成Dictionary<string, object>, 应该木有依赖呀

@2881099
Copy link
Collaborator

2881099 commented Apr 18, 2024

.net framework,还有 xamarin,这个之前已经遇到过,.net6高版本没有这个问题。

@hjkl950217
Copy link
Contributor Author

要不加一个条件编译? net6以上才有这个扩展

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

Successfully merging this pull request may close these issues.

None yet

2 participants