Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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.
It looks like not related to your issue, but there are no docs about MemberService events in documentation section - https://our.umbraco.org/documentation/reference/events/
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
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:
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.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted