Copied to clipboard

Flag this post as spam?

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


  • Luca Huber 2 posts 72 karma points
    Aug 21, 2015 @ 08:44
    Luca Huber
    0

    Class umbraco.cms.businesslogic.web Deprecated

    Im trying to add dynamic Propertys to a Document type with this code:

    using umbraco.cms.businesslogic.datatype;
    using umbraco.cms.businesslogic.web;
    
    
    
    var dt = DocumentType.GetByAlias("NAME");
    var pType = dt.AddPropertyType(new DataTypeDefinition(-49), "Alias", "Name");
    

    This works perfect, but the problem is that the class "umbraco.cms.businesslogic.web" is deprecated.

    Which Class can i use instead for the same functionality?

    Thanks.

  • Lars-Erik Aabech 349 posts 1100 karma points MVP 8x c-trib
    Aug 21, 2015 @ 10:20
    Lars-Erik Aabech
    0

    You should use the Umbraco.Core.Services.IContentTypeService instance in Umbraco.Web.UmbracoContext.Current.Application.Services.ContentTypeService.

    Googling "umbraco contenttypeservice" yealds; amongst others; this nice blogpost with an example of how to create a content type using the service.
    http://www.frakkingsweet.com/my-blog/create-content-type-in-umbraco

Please Sign in or register to post replies

Write your reply to:

Draft