Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Using Umbraco 8.1.0
I am trying to GetPagedChildren from IContentService with a IQuery
The multi-part identifier cmscontenttype alias could not be bound.
var filterQuery = Query<IContent>().Where(x => x.ContentType.Alias == "folderAlias");
var folder = _contentService.GetPagedChildren(1025, 1, 100, out long totalChildren, filterQuery).FirstOrDefault();
I build my service this way and added it to the composer.
private readonly IScopeProvider _scopeProvider;
protected IQuery<T> Query<T>() => _scopeProvider.SqlContext.Query<T>();
public MyService(IScopeProvider scopeProvider)
_scopeProvider = scopeProvider;
I have also tried this way, but it do not return anything.
var folder = _contentService.GetPagedChildren(1025, 1, 100, out long totalChildren).FirstOrDefault(x => x.ContentType.Alias.Equals("folderAlias"));
What do i do wrong?
Did you find a solution to this?
Currently getting the same error when trying to extend the backoffice contentResource API.
I have the same issue.
I found out that IContentService with a IQuery is very limited. So that aint an option to use like this.
How ever i got the GetPagedChildren to work if i change 1 to 0.
var folder = _contentService.GetPagedChildren(1025, 0, 100, out long totalChildren).FirstOrDefault();
Way late to the party but maybe this helps someone else. This works:
var filter = _sqlContext.Query<IContent>()
.Where(c => c.ContentTypeId.Equals(YourPageModel.GetModelContentType().Id));
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted