Copied to clipboard

Flag this post as spam?

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


  • Tom 6 posts 27 karma points
    Apr 27, 2015 @ 14:36
    Tom
    0

    Umbraco IMember AdditionalData

    Hi,

    I want to store some information for a member in Umbraco using the AdditionalData dictionary field.

    First I get the member (this code is located in a SurfaceController):

    var member = Services.MemberService.GetByUsername("username");
    

    Then I add the data

    member.AdditionalData.Add("SomeDataKey", "SomeData");
    

    And save it.

    Services.MemberService.Save(member);
    

    When I fetch the same member again after it has been saved, the member does not contain the AdditionalData anymore.

    I don't want to create an extra property to save this data. I want to use it as described in the documentation. (IUmbracoEntity: AdditionalData property)

    Some entities may expose additional data that other's might not, this custom data will be available in this collection
    

    Q: Am I missing something or could someone point me in the right direction?

    Q: Is the AdditionalData stored somewhere or is this temporary

    (Umbraco 7.2.4)

    Best regards,

    Tom

    (SO: http://stackoverflow.com/questions/29894218/umbraco-imember-additionaldata)

  • Peter Kongyik 28 posts 170 karma points
    Apr 27, 2015 @ 16:34
    Peter Kongyik
    0

    Hi there Tom!

    Looking at the umbraco source code (7.2.4) IMember.AdditionalData is only used with "NewPassword", "GeneratedPassword", "IsContainer" key. I don't think what you desire for is implemented, and based on these facts this property maybe shall rather be internal than public.

    best regards, Peter

  • Tom 6 posts 27 karma points
    Apr 27, 2015 @ 22:15
    Tom
    0

    Hi Peter,

    Darn, I hoped to use it as some kind of dynamic value without a visual property that needs to/could be managed in umbraco.
    But looking at the Save function itself, it has no knowlage of saving specif properties (link github around line 939) it just uses the .Serialize() function.

    Do you or someone else know maybe if there is some kind of mapping of what properties are serialized?

    Best regards,

    Tom

    EDIT; Found the mapper :p (link github) no sign of saving the additional data.


Please Sign in or register to post replies

Write your reply to:

Draft