public async Task <ActionResult <DoggoVideo> > PostDoggoVideo(DoggoVideo doggoVideo) { _context.doggoVideo.Add(doggoVideo); await _context.SaveChangesAsync(); return(CreatedAtAction("GetDoggoVideo", new { id = doggoVideo.DoggoVideoId }, doggoVideo)); }
public async Task <IActionResult> PutDoggoVideo(int id, DoggoVideo doggoVideo) { if (id != doggoVideo.DoggoVideoId) { return(BadRequest()); } _context.Entry(doggoVideo).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DoggoVideoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }