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 636 posts 1253 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?

Please Sign in or register to post replies

Write your reply to:

Draft