Copied to clipboard

Flag this post as spam?

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


  • Gary Cheetham 20 posts 144 karma points
    Apr 12, 2017 @ 14:19
    Gary Cheetham
    0

    Are IMember.IsApproved and IMember.GetValue<bool>("umbracoMemberApproved") equivalent?

    The code I am working on is using

    existingMember.GetValue<bool>("umbracoMemberApproved")
    

    in a number of places to check if a member has been approved.

    I noticed the property IMember.IsApproved in IntelliSense, and wondered if I could do a global find-replace to switch the code round and expect it to behave the same?

    I like the syntax without the "magic string" better.

  • Kevin Jump 2348 posts 14896 karma points MVP 8x c-trib
    Apr 13, 2017 @ 07:13
    Kevin Jump
    100

    Hi Gary,

    looking at the source i think they are the same thing.

    In the default membership provider the IsApproved settings is pulled from the umbracoMemberApproved property.

    https://github.com/umbraco/Umbraco-CMS/blob/5397f2c53acbdeb0805e1fe39fda938f571d295a/src/Umbraco.Web/Security/Providers/MembersMembershipProvider.cs#L34

    Kevin

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies