예제 #1
0
        public IActionResult PutVideo([FromRoute] Guid id, [FromBody] Video Video)
        {
            if (id != Video.Id)
            {
                return(BadRequest());
            }

            try
            {
                _videoService.Update(Video);
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!_videoService.Exists(p => p.Id == id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }