-
Notifications
You must be signed in to change notification settings - Fork 4
Yuhua's PR #3
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
base: main
Are you sure you want to change the base?
Yuhua's PR #3
Conversation
| private readonly IArticleRepository articleRepository = null; | ||
| private readonly IUserRepository userRepository = null; | ||
|
|
||
| public ArticleService(ArticleStore articleStore, UserStore userStore, IArticleRepository articleRepository, IUserRepository userRepository) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job: dependency injection
| string articleTitle = "Good day"; | ||
|
|
||
| Article article = new Article(userNameWhoWillAdd, articleTitle, articleContent); | ||
| User newUser = new User(userNameWhoWillAdd); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good mock.
|
Good points:
|
| public ArticleController(ArticleService articleService) | ||
| public ArticleController(ArticleStore articleStore, UserStore userStore, UserService userService, ArticleService articleService) | ||
| { | ||
| //this.articleStore = articleStore; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: remove dead code
| public async Task<List<Article>> ListAsync() | ||
| { | ||
| return await articleService.GetAll(); | ||
| Console.WriteLine(articleService.GetAllAsync()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: remove code for debug
| { | ||
| private readonly ArticleStore articleStore = null!; | ||
| private readonly UserStore userStore = null!; | ||
| private readonly ArticleService articleService = null!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: remove unused articleService
|
|
||
| namespace MiniBlog.Repositories | ||
| { | ||
| public class UserRepository : IUserRepository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well: nice to also provide repository for user

Sorry for single commit message; Forget to fork to my own repo