public async Task <ActionResult <DoggoPhoto> > PostDoggoPhoto(DoggoPhoto doggoPhoto) { _context.doggoPhoto.Add(doggoPhoto); await _context.SaveChangesAsync(); return(CreatedAtAction("GetDoggoPhoto", new { id = doggoPhoto.DoggoPhotoId }, doggoPhoto)); }
public async Task <IActionResult> PutDoggoPhoto(int id, DoggoPhoto doggoPhoto) { if (id != doggoPhoto.DoggoPhotoId) { return(BadRequest()); } _context.Entry(doggoPhoto).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DoggoPhotoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }