/// <summary> /// Deletes all claims from a user given a userId /// </summary> /// <param name="userId">The user's id</param> /// <returns></returns> public int Delete(string userId) { ConnectionService.ThreadVanityUrl = ConnectionName; AspNetUserClaimsQuery q = new AspNetUserClaimsQuery(); q.Where(q.UserId == userId); AspNetUserClaimsCollection coll = new AspNetUserClaimsCollection(); SetConnection(coll); if (coll.Load(q)) { coll.MarkAllAsDeleted(); coll.Save(); } return(1); }
/// <summary> /// Deletes a claim from a user /// </summary> /// <param name="user">The user to have a claim deleted</param> /// <param name="claim">A claim to be deleted from user</param> /// <returns></returns> public int Delete(IdentityUser user, Claim claim) { ConnectionService.ThreadVanityUrl = ConnectionName; AspNetUserClaimsQuery q = new AspNetUserClaimsQuery(); q.Where(q.UserId == user.Id && q.ClaimType == claim.Type && q.ClaimValue == claim.Value); AspNetUserClaimsCollection coll = new AspNetUserClaimsCollection(); SetConnection(coll); if (coll.Load(q)) { coll.MarkAllAsDeleted(); coll.Save(); } return(1); }