Skip to content

Global Elements: Refactor content and element repositories into a common base#21637

Merged
lauraneto merged 20 commits into
v18/devfrom
v18/feature/global-elements-repo-refactor
Feb 10, 2026
Merged

Global Elements: Refactor content and element repositories into a common base#21637
lauraneto merged 20 commits into
v18/devfrom
v18/feature/global-elements-repo-refactor

Conversation

@kjac

@kjac kjac commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

Prerequisites

  • I have added steps to test this contribution in the description below

Description

The ElementRepository implementation is pretty much a duplicate of DocumentRepository right now. This PR abstracts all shared code into a common PublishableContentRepositoryBase base 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 . from public to internal. This is breaking, but implementers should never use the DocumentRepository directly anyway (IDocumentRepository is 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.

@kjac kjac marked this pull request as ready for review February 5, 2026 17:12
@kjac kjac requested a review from lauraneto February 5, 2026 17:12
Comment thread src/Umbraco.Core/Cache/CacheKeys.cs
kjac and others added 5 commits February 9, 2026 19:23
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 lauraneto merged commit cf70d7f into v18/dev Feb 10, 2026
25 of 26 checks passed
@lauraneto lauraneto deleted the v18/feature/global-elements-repo-refactor branch February 10, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants