/// <summary> /// Persist a user's profile to the database. /// </summary> /// <param name="identity">An authenticated user's identity with a username that /// matches a user in the Identity table.</param> /// <param name="profile">Object that represents the user's profile. /// A single primitive, serializable object, or a dictionary of primitives and objects.</param> public void SetProfile(IIdentity identity, object profile) { ArgumentValidation.CheckForNullReference(identity, "identity"); ArgumentValidation.CheckForNullReference(profile, "profile"); Data.Database securityDb = GetSecurityDatabase(); string userName = identity.Name; using (IDbConnection connection = securityDb.GetConnection()) { connection.Open(); IDbTransaction transaction = connection.BeginTransaction(); try { DeleteProfile(userName, securityDb, transaction); InsertProfile(userName, SerializeProfile(profile), securityDb, transaction); } catch (ArgumentException) { throw; } catch (Exception e) { transaction.Rollback(); throw new InvalidOperationException(SR.SavingProfileException(userName), e); } transaction.Commit(); } SecurityProfileSaveEvent.Fire(identity.Name); }
private void FireSecurityProfileSaveEvent() { SecurityProfileSaveEvent.Fire(testMessage); }
private void FireecurityProfileSaveEvent() { SecurityProfileSaveEvent.Fire("test"); }