public IHttpActionResult PutCpuJezgre(int id, CpuJezgre cpuJezgre) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != cpuJezgre.Id) { return(BadRequest()); } db.Entry(cpuJezgre).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!CpuJezgreExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetCpuJezgre(int id) { CpuJezgre cpuJezgre = db.CpuJezgre.Find(id); if (cpuJezgre == null) { return(NotFound()); } return(Ok(cpuJezgre)); }
public IHttpActionResult PostCpuJezgre(CpuJezgre cpuJezgre) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.CpuJezgre.Add(cpuJezgre); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = cpuJezgre.Id }, cpuJezgre)); }
public IHttpActionResult DeleteCpuJezgre(int id) { CpuJezgre cpuJezgre = db.CpuJezgre.Find(id); if (cpuJezgre == null) { return(NotFound()); } db.CpuJezgre.Remove(cpuJezgre); db.SaveChanges(); return(Ok(cpuJezgre)); }