Ejemplo n.º 1
0
        internal string Delete(int id, string userId)
        {
            var exists = GetById(id);

            if (exists == null)
            {
                throw new Exception("Invalid id");
            }
            else if (userId != exists.UserId)
            {
                throw new Exception("You do not own this Keep peasant!");
            }
            _repo.Delete(id);
            return("Successfully Destroyed");
        }