Exemplo n.º 1
0
        internal string Delete(int id, string userId)
        {
            VaultKeep data = _repo.FindOne(id);

            if (data == null)
            {
                throw new Exception("Bad Id");
            }
            if (data.CreatorId != userId)
            {
                throw new Exception("Not user, Access Denied");
            }
            if (_repo.Delete(data.Id))
            {
                return("deleted succesfully");
            }
            return("did not remove succesfully");
        }