Copied to clipboard

Flag this post as spam?

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


  • Darryl 31 posts 112 karma points
    Sep 11, 2018 @ 17:29
    Darryl
    0

    Strongly Typed Models

    Hi, I was reading an article: click here to view about models builder, and I came across some syntax that has motivated me raise some questions, since it doesn't quite reflect the syntax when doing some basic get and set C# tutorials online.

    Are these equivalent:

    public string NewsTitle 
        {
            this.GetPropertyValue<string>(“newsTitle”);
        }
    
    public bool UmbracoNaviHide
    {
    get { return this.GetPropertyValue<bool>("umbracoNaviHide"); }
    }
    

    The only difference with the bottom example is that it uses the [ImplementPropertyType("umbracoNaviHide")] attribute.

    Also, can the first example be re-written as:

    public string NewsTitle = GetPropertyValue<string>(“newsTitle”);
    

    Any pointers would be much appreciated.

Please Sign in or register to post replies

Write your reply to:

Draft