Copied to clipboard

Flag this post as spam?

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


  • Alex 3 posts 83 karma points
    Nov 08, 2019 @ 16:07
    Alex
    0

    Get a specific contentType on Umbraco 8

    In Umbraco 7 I wrote like this

    ...
    IContentType dt = contentTypeService.GetContentType("nameCont");
    ...
    

    Now in Umbraco 8 which is the fastest method to get a specific contentType?

    Can anyone help me?

  • Thomas 315 posts 602 karma points c-trib
    Nov 13, 2019 @ 22:37
    Thomas
    0

    Hey,

    Can you use:

    IEnumerable<IPublishedContent> t = Umbraco.Content(1234).Descendants().Where(x => x.ContentType.Alias == "nameCont");
    
Please Sign in or register to post replies

Write your reply to:

Draft