Copied to clipboard

Flag this post as spam?

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


  • Lewis 27 posts 90 karma points
    Mar 12, 2015 @ 18:07
    Lewis
    0

    Using IRememberBeingDirty and WasDirty with Members and Properties

    Hey

    I update a property on a member from within the CMS and when MemberService.Saved event is triggered the member appears as dirty, but the property only appears as dirty in the entity.Properties collection. Using .WasPropertyDirty("alias") returns false.

    Am I missing something?

    private static void MemberServiceSaved(IMemberService sender, SaveEventArgs<IMember> e)
    {
        foreach (var entity in e.SavedEntities)
        {
            var member = (IRememberBeingDirty)entity;
    
            // true
            var wasMemberDirty = member.WasDirty();
    
            // false
            var propOneWasDirty = member.WasPropertyDirty("propOneAlias")
    
            // true
            var propOneWasDirtyByEntity = entity.Properties["propOneAlias"].WasDirty();
        }
    }
    

    Lewis

  • Lewis 27 posts 90 karma points
    Apr 23, 2015 @ 15:46
    Lewis
    0

    Also found this on the issue tracker: http://issues.umbraco.org/issue/U4-6035

    Has anyone had experience using these properties successfully?

    You can see below that the node is marked as dirty but the property in question is not.

    enter image description here

Please Sign in or register to post replies

Write your reply to:

Draft