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

Introduce methods on new service to have alternative to obsoleted methods #17208

Conversation

bergmania
Copy link
Member

Description

Fixes #17202

Introduce two methods on the IEntityTypeContainerService<T>:

  • Task<IEnumerable> GetAsync(string name, int level);
  • Task<IEnumerable> GetAllAsync();

Test

You can test it out by creating some data type folders and request them, e.g. just in a view like this

@using Umbraco.Cms.Core.Services
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage
@inject IDataTypeContainerService DataTypeContainerService;
@{
	Layout = null;

    var x = await DataTypeContainerService.GetAllAsync(); // returns all three
    var y = await DataTypeContainerService.GetAsync("Subfolder", 1); // Returns only the subfolder in the root
    var z = await DataTypeContainerService.GetAsync("Subfolder", 2); // Returns only the subfolder under folder
}

In this example I made the following folders

  • Folder
    • Subfolder
  • Subfolder

…atives for obsoleted methods. E.g. IDataTypeService.GetContainers(string folderName, int level) and a GetAllAsync
@bergmania bergmania changed the base branch from contrib to release/15.0 October 8, 2024 07:44
@bergmania bergmania changed the title V15/hotfix/17202 introduce methods on new service Introduce methods on new service to have alternative to obsoleted methods Oct 8, 2024
@nikolajlauridsen nikolajlauridsen merged commit a396335 into release/15.0 Oct 9, 2024
12 of 16 checks passed
@nikolajlauridsen nikolajlauridsen deleted the v15/hotfix/17202-introduce-methods-on-new-service branch October 9, 2024 07:55
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.

DataTypeService methods obsolete with no alternatives
2 participants