We are trying to upgrade from 10 to 11, and we can't find a way forward for method or property QueryDistinctAccess(AccessLevel.Read), see class and method below.
When going to 11, QueryDistinctAccess is not availble anymore, and we cant find any breaking changes documentation.
Do you have any idea about this issue?
Thanks in advance,
Mats & Fredrik
using System.Collections.Generic;
using System.Linq;
using EPiServer;
using EPiServer.Core;
using EPiServer.Filters;
using EPiServer.Security;
using EPiServer.ServiceLocation;
namespace KPA.EpiExtensions
{
public class SiteContentLoader: ISiteContentLoader
{
private readonly IContentLoader _contentLoader;
private readonly IPageCriteriaQueryService _pageCriteriaQueryService;
public SiteContentLoader()
{
_pageCriteriaQueryService = ServiceLocator.Current.GetInstance<IPageCriteriaQueryService>();
_contentLoader = ServiceLocator.Current.GetInstance<IContentLoader>();
}
public SiteContentLoader(IContentLoader contentLoader, IPageCriteriaQueryService pageCriteriaQueryService)
{
_contentLoader = contentLoader;
_pageCriteriaQueryService = pageCriteriaQueryService;
}
public IEnumerable<T> GetMenuChildren<T>(ContentReference contentReference) where T : IContent
{
return _contentLoader.GetChildren<T>(contentReference).Where(cr => cr.IsPublished() && cr.VisibleInMenu()).Where(c => c.QueryDistinctAccess(AccessLevel.Read));
}
}
public interface ISiteContentLoader
{
/// <summary>
/// GetChildren with filter VisibleInMenu AND IsPublished
/// </summary>
/// <typeparam name="T">IContent</typeparam>
/// <param name="contentReference">Content Reference</param>
/// <returns>List of Children</returns>
IEnumerable<T> GetMenuChildren<T>(ContentReference contentReference) where T : IContent;
}
}
Hi!
We are trying to upgrade from 10 to 11, and we can't find a way forward for method or property QueryDistinctAccess(AccessLevel.Read), see class and method below.
When going to 11, QueryDistinctAccess is not availble anymore, and we cant find any breaking changes documentation.
Do you have any idea about this issue?
Thanks in advance,
Mats & Fredrik