Copied to clipboard

Flag this post as spam?

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

  • Simon Dingley 1458 posts 3409 karma points c-trib
    May 16, 2017 @ 14:49
    Simon Dingley

    MemberService.Deleted Not Fired

    Are there any known issues with wiring up Member event handlers? I had a look on the issue tracker and didn't notice anything relevant. The issue I have is that I need to hook into the MemberService.Deleted event but it doesn't appear to be firing.

    I have it wired up as follows:

    public class MyApplication : ApplicationEventHandler
        private IMyMemberService _myMemberService;
        public MyApplication(IMyMemberService myMemberService)
            this._myMemberService = myMemberService;
        protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
            MemberService.Deleted += MemberService_Deleted;
        private void MemberService_Deleted(IMemberService sender, Umbraco.Core.Events.DeleteEventArgs<Umbraco.Core.Models.IMember> e)
            var member = this._myMemberService.GetByUserId((int)e.DeletedEntities.FirstOrDefault().ProviderUserKey);

    Any ideas appreciated.


  • Alex Skrypnyk 6079 posts 23433 karma points MVP 6x admin c-trib
    May 16, 2017 @ 17:10
    Alex Skrypnyk

    Hi Simon

    It looks like not related to your issue, but there are no docs about MemberService events in documentation section -

  • Asembli 53 posts 173 karma points
    Jan 13, 2020 @ 22:18


    hm late reply, but anyway, I was looking for the same fn and must say that this excerpt worked for me (7.15.3)

        public class DashboardEventHandler : ApplicationEventHandler
        public DashboardEventHandler()
            MemberService.Deleted += this.MemberServiceDeleted;
        private void MemberServiceDeleted(IMemberService sender, Umbraco.Core.Events.DeleteEventArgs<Umbraco.Core.Models.IMember> e)
            IMemberService memberService = ApplicationContext.Current.Services.MemberService;
            foreach (var item in e.DeletedEntities)
                // do something with member beeing deleted
                int memberId = item.Id;

    BTW if you work with Members section don't forget to include this patch:

    Regards, /Asembli

  • Samuel Racine 1 post 71 karma points
    Nov 26, 2020 @ 16:54
    Samuel Racine


    Turns out that it seems that your cannot inject a dependency in this class. I did it the way Asembli did but with an injected component in the constructor and the MemberServiceDeleted method wasn't hit when deleting a member. Then I removed the injection and it worked like a charm.



Please Sign in or register to post replies

Write your reply to: