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);
            }
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     return(RatingId.GetHashCode());
 }
Ejemplo n.º 4
0
 public IActionResult DeleteRating([FromBody] RatingId data)
 {
     return(Json(ratingService.DeleteRatingFromDB(data)));
 }