-
Notifications
You must be signed in to change notification settings - Fork 28
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
CreateModelMaybeAsync encourages bad practice (OSOE-894) #280
Comments
Yeah, that makes sense, thank you. |
I disagree with removing the method altogether.
This has already been addressed in branch
Okay, but that doesn't help with already existing drivers that directly inherit from Also What we could do instead, is splitting the method into two separate overloads with or without the |
Where do you use it outside of SectionDisplayDriver<ISite,TSection> aka SiteDisplayDriver? I also think it also hides too much logic and makes the code a bit more harder to read and understand. Writing the logic directly into the UpdateAsync is much cleaner and readable form my point event of view if that means writing little more "readable" code. |
Nowhere, I think you misunderstood. If the check is in
I strongly disagree, it only hides boilerplate logic. That's the purpose of shortcut methods. Also I don't think repeating simple scaffolding logic makes the code more readable, it just makes the reader's eyes glaze over with repetition, making it harder to spot meaningful change. Also makes the code base harder to search and more tedious to maintain too. |
Sári did what she described above under #281. |
Not that we have
SiteDisplayDriver<>
I suggest removing the CreateModelMaybeAsyncHelpful-Libraries/Lombiq.HelpfulLibraries.OrchardCore/Contents/BuildEditorContextExtensions.cs
Line 8 in 2111aa6
for two reason,
Jira issue
The text was updated successfully, but these errors were encountered: