public ActionResult DeleteConfirmed(long id) { VertexDb vertexDb = db.VertexDb.Find(id); db.VertexDb.Remove(vertexDb); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,identifier,name,service_id")] VertexDb vertexDb) { if (ModelState.IsValid) { db.Entry(vertexDb).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.service_id = new SelectList(db.ServiceDb, "id", "name", vertexDb.service_id); return(View(vertexDb)); }
// GET: VertexDbs/Details/5 public ActionResult Details(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } VertexDb vertexDb = db.VertexDb.Find(id); if (vertexDb == null) { return(HttpNotFound()); } return(View(vertexDb)); }
// GET: VertexDbs/Edit/5 public ActionResult Edit(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } VertexDb vertexDb = db.VertexDb.Find(id); if (vertexDb == null) { return(HttpNotFound()); } ViewBag.service_id = new SelectList(db.ServiceDb, "id", "name", vertexDb.service_id); return(View(vertexDb)); }
//POST: /api/FlickrFollowersAPI/FlickrFollowers public void IsUserIdInVertex(string VertexId, int serviceID, string VertexName = null) { var existUser = network.VertexDb.Where <VertexDb>(x => x.identifier == VertexId && x.service_id == serviceID).ToList(); if (existUser.Count == 0 && VertexName != null) { var vertex = new VertexDb(); vertex.identifier = VertexId; vertex.service_id = serviceID; vertex.name = VertexName; network.VertexDb.Add(vertex); network.SaveChanges(); } else if (existUser.Count == 0 && VertexName == null) { var vertex = new VertexDb(); vertex.identifier = VertexId; vertex.service_id = serviceID; network.VertexDb.Add(vertex); network.SaveChanges(); } }