public ActionResult Edit([Bind(Include = "LinkId,LinkType,Link,Username,Password,CreatedDate,ModifiedDate,AppId")] Links links) { if (ModelState.IsValid) { using (LinksDBContext context = new LinksDBContext()) { links.CreatedDate = links.CreatedDate; links.ModifiedDate = DateTime.Now; } db.Entry(links).State = EntityState.Modified; db.SaveChanges(); if (Session["appid"] == null || Session["env"] == null) { return(RedirectToAction("Index")); } else { return(RedirectToAction("Index", new { app_id = Convert.ToInt32(Session["appid"].ToString()), env = Session["env"].ToString() })); } } ViewBag.AppId = new SelectList(db.Applications, "AppId", "AppName", links.AppId); return(View(links)); }
public LinkRepository(LinksDBContext dbContext) { this.dbContext = dbContext; }