public async Task <ActionResult <Dbimage> > PostDbimage(Dbimage dbimage) { _context.Dbimage.Add(dbimage); await _context.SaveChangesAsync(); return(CreatedAtAction("GetDbimage", new { id = dbimage.Id }, dbimage)); }
public async Task <IActionResult> PutDbimage(int id, Dbimage dbimage) { if (id != dbimage.Id) { return(BadRequest()); } _context.Entry(dbimage).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DbimageExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }