Code Quality: Clean up Files.Actions phase 1
Code Quality: Clean up Files.Actions
Motivation & Context
- Improved readability
Warning
Please do not review code lines that I did not changed. I cannot make more diff. If there're more codes that are preferred to change, I will do that and mark that PR as the final one for that stage.
PR Checklist
- [x] Were these changes approved in an issue or discussion with the project maintainers? In order to prevent extra work, feature requests and changes to the codebase must be approved before the pull request will be reviewed. This prevents extra work for the contributors and maintainers. Related #4180
- [x] Did you build the app and test your changes?
- [ ] Did you check for accessibility? You can use Accessibility Insights for this.
- [ ] Did you remove any strings from the en-us resource file?
- [ ] Did you search the solution to see if the string is still being used?
- [ ] Did you implement any design changes to an existing feature?
- [ ] Was this change approved?
- [ ] Are there any other steps that were used to validate these changes?
Screenshots
None
You should consider opening a different PR to refactor the initialization of context in most actions.
How come should I? I think it’s fine so far. Probably I will split up phase 1 PR into multiple PRs, so reviewers can review quickly and easily.
How come should I? I think it’s fine so far.
There are a lot of Actions which use
private readonly IContentApplicationContext context = Ioc.Default.GetRequired<IContentPageContext>();
I think the assignment should be moved to the constructor
I think the assignment should be moved to the constructor
All of them were moved.
Ready for final review.
@yaira2 Ready to merge?
@0x5bfa this looks like a big change, I'd like to get a second review before merging.
Should I have split up into like 3 PRs? I can do that instead of fixing conflicts and waiting reviews.
We can do them together
@0x5bfa besides for formatting, were there any other changes?
Change overview
- Moved initializers to the constructors (i.e. dependency injection initializings)
- Improved formatting
- Updated return values of Execute(); (i.e. removing async for non-async) You can see this changing in ferrariofilippo's reviews