Copied to clipboard

Flag this post as spam?

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


  • Mike Chambers 621 posts 1203 karma points c-trib
    Apr 28, 2015 @ 14:05
    Mike Chambers
    0

    refactoring DocumentType to ContentType.

    So trying to refactor u4 code to v6....

    umbraco.cms.businesslogic.web.DocumentType DocTypeFile = umbraco.cms.businesslogic.web.DocumentType.GetByAlias("FileDocument");
    ....
    switch (DocTypeFile.getPropertyType(property.Alias).DataTypeDefinition.Text)                         {case "Content Picker":                                 
                                 break;
                                 
                                 case "Media Picker":
                                 break;
                                 case "Textstring":
                                 break;
    }

     

    I can get to 

    Umbraco.Core.Models.IContentType DocTypeFile = Umbraco.Core.ApplicationContext.Current.Services.ContentTypeService.GetContentType("FileDocument");

    But then get stuck trying to find a method on IContentType to refactor 

    DocTypeFile.getPropertyType(property.Alias).DataTypeDefinition.Text

    Any pointers?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies