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
I have project which has Dependency injection controlled by SimpleInjector.
Now, I have a class which is implementing from ApplicationEventHandler where I want to listen to such member service event. In such events, I want to call such services which do some logic, as below:
public class MemberServiceEventsHandler : ApplicationEventHandler
private readonly ISetMemberThatApprovalHasBeenDoneAtLeastOnceService _setMemberThatApprovalHasBeenDoneAtLeastOnceService;
public MemberServiceEventsHandler(ISetMemberThatApprovalHasBeenDoneAtLeastOnceService setMemberThatApprovalHasBeenDoneAtLeastOnceService)
_setMemberThatApprovalHasBeenDoneAtLeastOnceService = setMemberThatApprovalHasBeenDoneAtLeastOnceService;
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
MemberService.Saving += MemberService_Saving;
MemberService.Saved += MemberService_Saved;
private void MemberService_Saving(IMemberService sender, Umbraco.Core.Events.SaveEventArgs<Umbraco.Core.Models.IMember> e)
foreach (var node in e.SavedEntities)
if (node.ContentType.Alias == ConstantValues.DefaultMemberTypeAlias)
_memberApprovalStatusHasBeenChanged = node.IsPropertyDirty(ConstantValues.MemberIsApprovedAliasName);
But when I start the application and debugged accordingly, events are not being registered and eventaully it is not working.
I don't want to use such static call for service and use it like that unless there are no solution.
Appreciate any help.
Anyone can help me please?
Did you ever managed to get this working? I am having the same issue
Just on this, i never managed to get it working and instead have to retrieve the Interface from the service locator instead.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted