Пример #1
0
        public async Task <ActionResult <UserReviewType> > PostUserReviewType(UserReviewType UserReviewType)
        {
            _context.UserReviewType.Add(UserReviewType);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetUserReviewType", new { id = UserReviewType.LngRatingId }, UserReviewType));
        }
Пример #2
0
        public async Task <IActionResult> PutUserReviewType(byte id, UserReviewType UserReviewType)
        {
            if (id != UserReviewType.LngRatingId)
            {
                return(BadRequest());
            }

            _context.Entry(UserReviewType).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!UserReviewTypeExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }