Removes the need to do any lookup for GetNonGroupedProperties, we already know if they belong to a non-group based on the ID

This commit is contained in:
Shannon
2019-02-07 14:01:00 +11:00
parent 03eaf3aa3d
commit a9045c254e
4 changed files with 12 additions and 19 deletions

View File

@@ -106,15 +106,12 @@ namespace Umbraco.Core
/// Returns properties that do not belong to a group
/// </summary>
/// <param name="content"></param>
/// <param name="contentTypeBaseService"></param>
/// <returns></returns>
public static IEnumerable<Property> GetNonGroupedProperties(this IContentBase content, IContentTypeBaseServiceProvider contentTypeBaseService)
public static IEnumerable<Property> GetNonGroupedProperties(this IContentBase content)
{
var contentType = contentTypeBaseService.GetContentTypeOf(content);
var propertyIdsInTabs = contentType.PropertyGroups.SelectMany(pg => pg.PropertyTypes);
return content.Properties
.Where(property => propertyIdsInTabs.Contains(property.PropertyType) == false)
.OrderBy(x => x.PropertyType.SortOrder);
.Where(x => x.PropertyType.PropertyGroupId == null)
.OrderBy(x => x.PropertyType.SortOrder);
}
/// <summary>