public ActionResult DeletePlatform(int id) { try { //Validations var platform = _repository.GetPlatformById(id); if (platform == null) { return(NotFound()); } //Delete _repository.DeletePlatform(platform); _repository.SaveChanges(); //Response return(Ok()); } catch (Exception) { return(NotFound()); } }