public async Task <IActionResult> PutMedicine([FromRoute] int id, [FromBody] Medicine medicine) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != medicine.MedicineId) { return(BadRequest()); } _context.Entry(medicine).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MedicineExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutPackageLeaflet([FromRoute] int id, [FromBody] PackageLeaflet packageLeaflet) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != packageLeaflet.PackageLeafletId) { return(BadRequest()); } _context.Entry(packageLeaflet).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PackageLeafletExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }