Copied to clipboard

Flag this post as spam?

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


  • Will Waggoner 17 posts 38 karma points
    Nov 01, 2010 @ 23:24
    Will Waggoner
    0

    proper way to retrieve umbraco Members

    I've been doing some custom extensions that involve pulling umbraco.cms.businesslogic.member.Member classes and am curious about something.  The GetMember* methods are marked as deprecated and claim that you should use the System.Web.Security.Member.GetMember* methods instead--but those return a different class type.  I need the real umbraco Member with the getProperty() functionality.  What's the most efficient and proper manner to retrieve a member given their email or login?

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Nov 01, 2010 @ 23:26
    Aaron Powell
    0

    You should use the ASP.NET ProfileProvider API which allows you to create a strongly typed class representing the member type: http://www.aaron-powell.com/umbraco-members-profiles

  • Thomas Stock 40 posts 70 karma points
    Nov 02, 2010 @ 11:11
    Thomas Stock
    0

    Slace,

    I've checked your blog post but there's something I do not understand.

    I see you declare custom properties in your web.config like this:

    <add name="first_name" ..............

    But these properties are also already declared in the umbraco backoffice, right?

    Why this duplicate entry? It doesn't seem right.

    While implementing I noticed this method:

    ProfileManager.AddDynamicProfileProperty(new ProfilePropertySettings("my_property"));

    Isn't this something umbraco could use to add the properties defined in the umbraco backend? (that method can only be called at app initialization)

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Nov 02, 2010 @ 11:32
    Aaron Powell
    0

    I'm not familiar with that API method so I'm not sure if it can be used, you'd have to test it.

    The reason I went with my implementation is because I wanted a strongly typed representation of the member type, something that's *kind of* a DTO.

Please Sign in or register to post replies

Write your reply to:

Draft