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

            if (found == null)
            {
                throw new Exception("Keep not saved to vault");
            }
            if (found.UserId != userId)
            {
                throw new Exception("Unauthorized");
            }
            _repo.Delete(found.Id);
            return("Successfully removed");
        }