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

项目无sqlsugar的日志功能 #10

Closed
813026685 opened this issue Apr 17, 2019 · 3 comments
Closed

项目无sqlsugar的日志功能 #10

813026685 opened this issue Apr 17, 2019 · 3 comments
Labels
好问题 Good for newcomers 已完成

Comments

@813026685
Copy link

希望增加sqlsugar的日志功能

@anjoy8
Copy link
Owner

anjoy8 commented Apr 17, 2019

1、我在仓储层,本来是写了一个自定义的日志记录,没有用Log4,只是一个简单的日志输出;
2、刚刚试了试,我把LogHelper,移动到了 Common 层,但是在 Repository 层的 DbContext.cs 中依旧不能使用构造函数注入;
3、因为 DbContext 这个实体类并没有自己的接口,而且API层也解耦了 Repository 层,所以,我是这么用的,
image

4、如果你想在 BaseRepository 中注入的话,就需要在每一个子类仓储中都注入,改动太大

@anjoy8
Copy link
Owner

anjoy8 commented Apr 17, 2019

image

image

我还没想到那种,只需要在父类构造函数注入,而不用管子类的

@813026685
Copy link
Author

那就要考虑日志这块不能用注入了

@anjoy8 anjoy8 added 好问题 Good for newcomers 已完成 labels Oct 30, 2019
anjoy8 pushed a commit that referenced this issue May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
好问题 Good for newcomers 已完成
Projects
None yet
Development

No branches or pull requests

2 participants