public static void RaiseExternalUserCreating(zAppDev.DotNet.Framework.Identity.Model.ApplicationUser user, string _groupName = null) { log4net.LogManager.GetLogger(typeof(EventsHub)).Debug("Event 'ExternalUserCreating' was triggered"); if (ExternalUserCreatingListeners.Count > 0) { ProcessListeners(ExternalUserCreatingListeners.Select(listener => new Action(() => { listener(user); })), false, true); } }
public void DeleteApplicationUser(zAppDev.DotNet.Framework.Identity.Model.ApplicationUser applicationuser, bool doNotCallDeleteForThis = false, bool isCascaded = false, object calledBy = null) { if (applicationuser == null || applicationuser.IsTransient()) { return; } foreach (var toDelete in applicationuser.Clients) { applicationuser.RemoveClients(toDelete); DeleteApplicationClient(toDelete, false, isCascaded); } foreach (var toDelete in applicationuser.Logins) { applicationuser.RemoveLogins(toDelete); DeleteApplicationUserLogin(toDelete, false, isCascaded); } foreach (var toDelete in applicationuser.Claims) { applicationuser.RemoveClaims(toDelete); DeleteApplicationUserClaim(toDelete, false, isCascaded); } foreach (var toDissasociate in applicationuser.Permissions) { applicationuser.RemovePermissions(toDissasociate); } if (applicationuser.Profile != null) { var toDelete = applicationuser.Profile; applicationuser.Profile = null; DeleteProfile(toDelete, false, isCascaded, applicationuser); } foreach (var toDissasociate in applicationuser.Roles) { applicationuser.RemoveRoles(toDissasociate); } if (!doNotCallDeleteForThis) { Delete <zAppDev.DotNet.Framework.Identity.Model.ApplicationUser>(applicationuser, isCascaded); } }
public void RaiseExternalUserCreatingEvent(zAppDev.DotNet.Framework.Identity.Model.ApplicationUser user, string _groupName = null) { RaiseExternalUserCreating(user, _groupName); }