public IHttpActionResult Put胶料入库(Guid id, 胶料入库 胶料入库) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != 胶料入库.Id) { return(BadRequest()); } db.Entry(胶料入库).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!胶料入库Exists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult Post胶料入库(胶料入库 胶料入库) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.胶料入库.Add(胶料入库); try { db.SaveChanges(); } catch (DbUpdateException) { if (胶料入库Exists(胶料入库.Id)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = 胶料入库.Id }, 胶料入库)); }
public IHttpActionResult Get胶料入库(Guid id) { 胶料入库 胶料入库 = db.胶料入库.Find(id); if (胶料入库 == null) { return(NotFound()); } return(Ok(胶料入库)); }