//public async Task<bool> Delete(ISiteUser user) //{ // bool result = await DeleteLoginsByUser(user.SiteId, user.Id); // result = await DeleteClaimsByUser(user.SiteId, user.Id); // result = await DeleteUserRoles(user.UserId); // result = await dbSiteUser.DeleteUser(user.UserId); // return result; //} public async Task <bool> Delete(int siteId, int userId, CancellationToken cancellationToken = default(CancellationToken)) { cancellationToken.ThrowIfCancellationRequested(); ISiteUser user = await Fetch(siteId, userId); if (user != null) { bool result = await DeleteLoginsByUser(user.SiteId, user.Id); result = await DeleteClaimsByUser(user.SiteId, user.Id); result = await DeleteUserRoles(user.UserId); } return(await dbSiteUser.DeleteUser(userId)); }
/// <summary> /// Deletes an instance of User. Returns true on success. /// </summary> /// <param name="userID"> userID </param> /// <returns>bool</returns> public async Task <bool> Delete(int userId) { return(dbSiteUser.DeleteUser(userId)); }