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 298 posts 1306 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?

Please Sign in or register to post replies

Write your reply to:

Draft