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

请问 为何每个Repository(IUnitOfWork unitOfWork) 都要传递这个unitOfWork #62

Closed
jol5 opened this issue Apr 13, 2020 · 2 comments

Comments

@jol5
Copy link

jol5 commented Apr 13, 2020

XXXRepository通过反射加入容器,那这个 IUnitOfWork 肯定来源于容器依赖注入,IUnitOfWork 依赖于SqlSugarClient的ADO事务;这种传递是为何?也没见类内部使用啊。
如果想用跨方法事务,直接在构造方法注入即可,开启线程share,难道不传时,直接注入IUnitOfWork 会出问题?

@anjoy8
Copy link
Owner

anjoy8 commented Apr 13, 2020

1、你在哪里直接注入IUnitOfWork?
2、你可以先按照你的思路修改下,看看效果

@jol5
Copy link
Author

jol5 commented Apr 13, 2020

1、你在哪里直接注入IUnitOfWork?
2、你可以先按照你的思路修改下,看看效果

那在全部respository 构造函数注入unitofwork 是出于什么原因呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants