private void DeleteActorExecute() { try { Actor.Deleted = true; _dALActor.DeleteActor(Actor.Id); Actors = _dALActor.AllActors(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public IHttpActionResult DeleteActor(int id) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } Actor actor = _dALActor.GetActorById(id); if (id != actor.Id) { return(BadRequest()); } actor.Deleted = true; _dALActor.DeleteActor(actor.Id); return(StatusCode(HttpStatusCode.NoContent)); }