Skip to content

Composed properties are always generated ignoring "ImplementPropertyType". #128

@SayTen

Description

@SayTen
  • I have a document type called "SeoComposition" that is used by a page.
  • I was trying to override the MetaDescription so that it could fall back to another property in the case that it hadn't been filled in.
  • I'm using the Visual Studio plugin to generate code.
  • Umbraco Version is 7.5.3

The generated class would be something like:

public partial class Page: PublishedContentModel, ISeoComposition
{
    ...
    ///<summary>
    /// Meta Description
    ///</summary>
    [ImplementPropertyType("metaDescription")]
    public string MetaDescription
    {
        get { return SeoComposition.GetMetaDescription(this); }
    }
    ...
}

And my custom half is something like:

    public partial class Page
    {
        [ImplementPropertyType("metaDescription")]
        public string MetaDescription
        {
            get
            {
                // if metaDescription is set return that, otherwise return another processed property.
            }
        }

My issue is that with the ImplementPropertyType on the concrete class for a composed property it is generated when running the tool again. I've seen similar issues both open and closed but I'm not looking to change the interface signature here. Is this replicatable by someone else?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions