Copied to clipboard

Flag this post as spam?

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


  • James 10 posts 50 karma points
    Dec 28, 2014 @ 02:39
    James
    0

    Store Umbraco Member Properties in Separate Table

    I want to create a membership based site in Umbraco 7, following the umbraco.tv videos and reading through the docs have got me quite far.

    My members will have custom properties, firstname, lastname, favourite colours, hats owned etc. I have been adding each of these as custom properties and then assigning them to the tab I want. This works fine and I can then access them from code using:

    Members.GetCurrentMember().GetProperty("lastname").Value.ToString();
    

    When I looked in my database I noticed that each of these custom properties is a row in the cmsPropertyData table, linked to the cmsMember table by the nodeId column. Is there a way I can set all of this information to store in it's own table?

    Ideally, I want each Member to have a one to many relationship with favourite colours, as well as one to many relationships with other tables; each member might have 100 hats for example. What is the best way for me to set this up? Shall I create custom tables in my Umbraco database for HatsOwned and FavouriteColours, then assign each Member a unique ID so I can set my foreign keys up correctly? That way I would only need to store the Members Unique ID in the cmsPropertyTable. Is there a better way to let Umbraco deal with it? Would I have difficulty retrieving Members using either the Umbraco orm, or EF?

    Any help or pointers greatly appreciated!

Please Sign in or register to post replies

Write your reply to:

Draft