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

Cleanup IContentManager #16077

Merged
merged 22 commits into from
May 22, 2024
Merged

Conversation

MikeAlhayek
Copy link
Member

@MikeAlhayek MikeAlhayek commented May 16, 2024

Cleanup the IContentManager

Fix #16027

@MikeAlhayek MikeAlhayek requested a review from Piedone May 16, 2024 18:31
Copy link
Member

@Piedone Piedone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build is failing.

@MikeAlhayek MikeAlhayek requested a review from Piedone May 16, 2024 21:30
@MikeAlhayek MikeAlhayek requested a review from Piedone May 17, 2024 17:03
@MikeAlhayek
Copy link
Member Author

@Piedone even better, I also Fixed #16027 by handling the all versions option.

@Piedone
Copy link
Member

Piedone commented May 17, 2024

Awesome!

Copy link
Member

@Piedone Piedone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sebastienros can I get your second opinion, specifically on using VersionOptions options = null, i.e. an optional parameter instead of overloads with and without?

I think this is good but I'm wondering if I'm missing something. It's source-compatible but perhaps not binary-compatible, but 2.0 is breaking anyway, you have to recompile, it doesn't matter. Overloads are preferred instead of optional parameters if you need compatibility with all .NET languages, but that doesn't matter for us either. Anything else?

MikeAlhayek and others added 4 commits May 17, 2024 11:32
/// <example>GetContentItemByIdAsync("4xxxxxxxxxxxxxxxx").</example>
/// <returns>A content item with the specific id, or <c>null</c> if it doesn't exist.</returns>
public static Task<ContentItem> GetContentItemByIdAsync(this IOrchardHelper orchardHelper, string contentItemId, bool latest = false)
public static Task<ContentItem> GetContentItemByIdAsync(this IOrchardHelper orchardHelper, string contentItemId, VersionOptions option = null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

= null, why not the actual default value that is documented? I know this is what will be used internally but that would make more sense. If the other default changes for instance.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VersionOptions is a class. How can we provide a default value to the argument?

@MikeAlhayek MikeAlhayek requested a review from Piedone May 21, 2024 20:26
@MikeAlhayek MikeAlhayek merged commit 77c69c6 into main May 22, 2024
12 checks passed
@MikeAlhayek MikeAlhayek deleted the ma/remove-options-from-content-manager branch May 22, 2024 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove VersionOptions.AllVersions
4 participants