public IHttpActionResult PostvwRegistry(vwRegistry vwRegistry) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.vwRegistries.Add(vwRegistry); try { db.SaveChanges(); } catch (DbUpdateException) { if (vwRegistryExists(vwRegistry.id)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = vwRegistry.id }, vwRegistry)); }
public IHttpActionResult PutvwRegistry(Guid id, vwRegistry vwRegistry) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != vwRegistry.id) { return(BadRequest()); } db.Entry(vwRegistry).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!vwRegistryExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult DeleteConfirmed(Guid id) { vwRegistry vwRegistry = db.vwRegistries.Find(id); db.vwRegistries.Remove(vwRegistry); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,registry,entry")] vwRegistry vwRegistry) { if (ModelState.IsValid) { db.Entry(vwRegistry).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(vwRegistry)); }
public IHttpActionResult GetvwRegistry(Guid id) { vwRegistry vwRegistry = db.vwRegistries.Find(id); if (vwRegistry == null) { return(NotFound()); } return(Ok(vwRegistry)); }
public ActionResult Create([Bind(Include = "id,registry,entry")] vwRegistry vwRegistry) { if (ModelState.IsValid) { vwRegistry.id = Guid.NewGuid(); db.vwRegistries.Add(vwRegistry); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(vwRegistry)); }
// GET: vwRegistries/Delete/5 public ActionResult Delete(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } vwRegistry vwRegistry = db.vwRegistries.Find(id); if (vwRegistry == null) { return(HttpNotFound()); } return(View(vwRegistry)); }
public IHttpActionResult DeletevwRegistry(Guid id) { vwRegistry vwRegistry = db.vwRegistries.Find(id); if (vwRegistry == null) { return(NotFound()); } db.vwRegistries.Remove(vwRegistry); db.SaveChanges(); return(Ok(vwRegistry)); }