示例#1
0
        internal VaultKeep Delete(int Id, string userId)
        {
            VaultKeep found = _repo.GetVaultKeepsByVaultKeepId(Id);

            if (found.UserId != userId)
            {
                throw new UnauthorizedAccessException("Invalid Request");
            }
            if (_repo.Delete(Id))
            {
                return(found);
            }
            throw new Exception("An unknown error has occurred");
        }