internal bool DeleteRatingFromDB(RatingId data) { try { var x = context.Rating .Where(i => i.Id == data.RatingID) .SingleOrDefault(); context.Rating.Remove(x); context.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public override int GetHashCode() { int hash = 1; if (RatingId != 0) { hash ^= RatingId.GetHashCode(); } if (RatingName.Length != 0) { hash ^= RatingName.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
/// <inheritdoc /> public override int GetHashCode() { return(RatingId.GetHashCode()); }
public IActionResult DeleteRating([FromBody] RatingId data) { return(Json(ratingService.DeleteRatingFromDB(data))); }