public IActionResult DeleteFavorite([FromBody] Favorite favorite) { string msg; FavoriteDAO dao = new FavoriteDAO(_context); if (dao.Delete(favorite)) { msg = "Delete accessory from favorite list successfully"; } else { msg = "Delete accessory from favorite list failed"; } return(new JsonResult(msg)); }
/// <summary> /// 删除一条记录 /// </summary> /// <param name="favorites_id">主键</param> /// <returns>是否成功</returns> public bool Delete(long favorites_id) { return(_dao.Delete(favorites_id)); }