/// <summary> /// Inserts a new claim in UserClaims table /// </summary> /// <param name="UserClaim">User's claim to be added</param> /// <param name="userId">User's id</param> /// <returns></returns> public int Insert(UserClaim userClaim) { using (var conn = db.GetOpenConnection()) { return conn.Execute(@"INSERT INTO UserClaim (ClaimValue, ClaimType, UserID) VALUES (@value, @type, @userId)", new { value = userClaim.Claim.Value, type = userClaim.Claim.Type, userId = userClaim.User.UserID }); } }
/// <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 void Delete(UserClaim userClaim) { using (var conn = db.GetOpenConnection()) { conn.Execute(@"DELETE FROM UserClaim WHERE UserID = @userId and @ClaimValue = @value and ClaimType = @type", new { userID = userClaim.User.UserID, ClaimValue = userClaim.Claim.Value, type = userClaim.Claim.Type }); } }
public void Update(UserClaim item) { throw new NotImplementedException(); }