Global Elements: Refactor content and element repositories into a common base#21637
Merged
Conversation
…-refactor' into v18/feature/global-elements-repo-refactor
lauraneto
reviewed
Feb 9, 2026
Co-authored-by: Laura Neto <12862535+lauraneto@users.noreply.github.com>
…PublishableContentRepositoryBase.cs Co-authored-by: Laura Neto <12862535+lauraneto@users.noreply.github.com>
…PublishableContentRepositoryBase.cs Co-authored-by: Laura Neto <12862535+lauraneto@users.noreply.github.com>
lauraneto
approved these changes
Feb 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prerequisites
Description
The
ElementRepositoryimplementation is pretty much a duplicate ofDocumentRepositoryright now. This PR abstracts all shared code into a commonPublishableContentRepositoryBasebase class.Pay special attention to
A few more DTOs have been given interface definitions to help NPoco resolve queries - for example,
ICultureVariationDto. This follows a previously established pattern, but do pay special attention to this when reviewing all the same.Breaking change
To keep the DTO interface definitions from leaking out for consumption outside of the infrastructure layer, all of these have been marked as
internal. This is not breaking, because they do not exist in V17.However, it does force a change of visibility for the
DocumentRepository. frompublictointernal. This is breaking, but implementers should never use theDocumentRepositorydirectly anyway (IDocumentRepositoryis public), so I think it's a fair tradeoff.Testing
There should be no functional changes from this PR. This is purely an internal refactor to reduce code duplication.