Copied to clipboard

Flag this post as spam?

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


  • Alex Perotti 53 posts 94 karma points
    Sep 21, 2014 @ 12:31
    Alex Perotti
    0

    Converting IPublishedContentProperty to IPublishedProperty

    Hi everyone,

    I'm moving an old package to umbraco 7 and I have an issue with IPublishedContentProperty interfaces.

    It seems it is changed to IPublishedProperty, which is quite different to implement

    Can someone give me some advice?

    Here's my old code

     public class BlogProperty : IPublishedContentProperty
    {
        public string Alias
        {
            get;
            private set;
        }
    
        public object Value
        {
            get;
            private set;
        }
    
        public System.Guid Version
        {
            get;
            private set;
        }
    
        public BlogProperty(string alias, object value)
        {
            Alias = alias;
            Value = value;
            Version = System.Guid.NewGuid();
        }
    }
    

    that throws an error on compile (PublishedContentProperty seems to not exist anymore)

    Thank you

  • Jonas Eriksson 930 posts 1825 karma points
    Sep 26, 2014 @ 13:18
    Jonas Eriksson
    0

    If you need Version (on the property) respond to this issue, but otherwise I think you'll be good just by removing version and change from Alias to PropertyTypeAlias. 

    http://issues.umbraco.org/issue/U4-4773

    "Breaking change. Alias is now PropertyTypeAlias and Version is gone because it was meaningless for properties (returned Guid.Empty)"

     

  • Alex Perotti 53 posts 94 karma points
    Sep 26, 2014 @ 17:42
    Alex Perotti
    0

    Thank you Jonas

Please Sign in or register to post replies

Write your reply to:

Draft