Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bo Jacobsen 351 posts 1527 karma points
    Jul 24, 2019 @ 14:42
    Bo Jacobsen
    0

    The multi-part identifier cmscontenttype alias could not be bound

    Hi all.

    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?

  • Neil Chapman 17 posts 119 karma points
    Dec 03, 2019 @ 09:55
    Neil Chapman
    0

    Did you find a solution to this?

    Currently getting the same error when trying to extend the backoffice contentResource API.

  • Dmitriy Larionov 1 post 21 karma points
    28 days ago
    Dmitriy Larionov
    0

    I have the same issue.

  • Bo Jacobsen 351 posts 1527 karma points
    27 days ago
    Bo Jacobsen
    0

    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.

    like this.

    var folder = _contentService.GetPagedChildren(1025, 0, 100, out long totalChildren).FirstOrDefault();
    
Please Sign in or register to post replies

Write your reply to:

Draft