Copied to clipboard

Flag this post as spam?

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


  • Dan Mac 12 posts 32 karma points
    Apr 02, 2012 @ 19:54
    Dan Mac
    0

    5.1 automatically map to a specific domain type

    Hi all,

    I'm using Umbraco 5.1 is there anything in the API that lets you automatically map to a specific domain type. For example see below code. This by the way returns empty properties (title, body text, browser title, etc).

    Thanks,
    Dan

    public override ActionResult Index(IUmbracoRenderModel model)
    {
      HomePage homePage = _hiveManager.QueryContent<HomePage>().GetById(new HiveId("2646fa7b9a0547e0b932a02701277679"));
    
            return View();
    }
    public class HomePage : Umbraco.Cms.Web.Model.Content
        {
            public string Title { get; set; }
            public string BodyText { get; set; }
            public string BrowserTitle { get; set; }
            public string MetaKeywords { get; set; }
            public string MetaDescription { get; set; }
        }
  • Niels Hartvig 1951 posts 2391 karma points c-trib
    Apr 04, 2012 @ 16:08
    Niels Hartvig
    0

    Not currently but 5.3 scheduled summer will feature "Code First" which can turn POCOs into doctypes (and reverse).

  • Dan Mac 12 posts 32 karma points
    Apr 04, 2012 @ 16:17
    Dan Mac
    0

    Hey Niels thanks for the reply. Looking forward to future releases!

    Dan

Please Sign in or register to post replies

Write your reply to:

Draft