public override int DeleteProfiles(ProfileInfoCollection profiles) { return DeleteProfiles(profiles .Cast<ProfileInfo>() .Select(profile => profile.UserName) .ToArray()); }
public override int DeleteProfiles(ProfileInfoCollection profiles) { var deleteCount = 0; try { deleteCount = profiles.Cast<ProfileInfo>().Count(p => DeleteProfile(p.UserName)); } catch (Exception ex) { if (WriteExceptionsToEventLog) { WriteToEventLog(ex, "DeleteProfiles(ProfileInfoCollection)"); throw new ProviderException(exceptionMessage); } throw; } return deleteCount; }
public override int DeleteProfiles(ProfileInfoCollection profiles) { Condition.Requires(profiles, "profiles").IsNotNull(); int i; using (var db = this.ConnectToDatabase()) { DeleteUserInRoles(db, profiles); DeleteOAuthMembership(db, profiles); DeleteMembership(db, profiles); i = profiles.Cast<ProfileInfo>() .Sum(profile => db.Execute(this.sqlQueryBuilder.DeleteProfile, profile.UserName)); } return i; }
/// <summary> /// When overridden in a derived class, deletes profile properties and information for the supplied list of profiles. /// </summary> /// <param name="profiles">A <see cref="T:System.Web.Profile.ProfileInfoCollection"></see> of information about profiles that are to be deleted.</param> /// <returns> /// The number of profiles deleted from the data source. /// </returns> public override int DeleteProfiles(ProfileInfoCollection profiles) { if (profiles == null) throw new ArgumentNullException("profiles"); IEnumerable<string> profilesToDelete = profiles.Cast<ProfileInfo>().Select(p => p.UserName); return this.DeleteProfiles(profilesToDelete.ToArray()); }
public override int DeleteProfiles(ProfileInfoCollection profiles) { if (!this.Initialized || this.ReadOnly) { return 0; } string[] usernames = (from profile in profiles.Cast<ProfileInfo>() select profile.UserName).ToArray<string>(); return this.DeleteProfiles(usernames); }
public override int DeleteProfiles(ProfileInfoCollection profiles) { if (profiles == null) { throw TraceException("DeleteProfiles", new ArgumentNullException("profiles")); } if (profiles.Count == 0) { return 0; } return DeleteProfiles(profiles.Cast<ProfileInfo>().Select(p => p.UserName).ToArray()); }
public override int DeleteProfiles(ProfileInfoCollection profiles) { var count = 0; Parallel.ForEach(profiles.Cast<ProfileInfo>(), profile => { if (DeleteProfile(profile.UserName, profile.IsAnonymous)) Interlocked.Increment(ref count); }); return count; }
private void DeleteUserInRoles(IDatabase db, ProfileInfoCollection profiles) { this.DeleteUserInRoles(db, profiles.Cast<ProfileInfo>().Select(x => x.UserName).ToArray()); }
private void DeleteOAuthMembership(IDatabase db, ProfileInfoCollection profiles) { this.DeleteOAuthMembership(db, profiles.Cast<ProfileInfo>().Select(x => x.UserName).ToArray()); }
/// <summary> /// When overridden in a derived class, deletes profile properties and information for the supplied list of profiles. /// </summary> /// <returns>The number of profiles deleted from the data source.</returns> /// <param name="profiles">A <see cref="T:System.Web.Profile.ProfileInfoCollection" /> of information about profiles that are to be deleted.</param> public override int DeleteProfiles(ProfileInfoCollection profiles) { if (profiles == null) { throw new ArgumentNullException("profiles"); } if (profiles.Count < 1) { throw new ArgumentException("profiles"); } string[] usernames = profiles.Cast<ProfileInfo>().Select(p => p.UserName).ToArray(); return DeleteProfiles(usernames); }