public IHttpActionResult DeleteFavorite(int id, int favoriteid) { try { FavoriteManager manager = new FavoriteManager(); Favorite temp = manager.Obtener(favoriteid); if (temp.customer.id == id) { Favorite result = manager.Eliminar(favoriteid); if (result != null) { return(Ok()); } else { return(BadRequest()); } } else { return(NotFound()); } }catch (Exception e) { return(NotFound()); } }