Пример #1
0
        public IActionResult DeleteActor(int actorId)
        {
            if (!_service.ActorExists(actorId))
            {
                return(NotFound());
            }

            var actorObj = _service.GetTheActor(actorId);

            if (!_service.DeleteActor(actorObj))
            {
                ModelState.AddModelError("", $"Something went wrong when deleting the record {actorObj.Name}");
                return(StatusCode(500, ModelState));
            }

            return(NoContent());
        }