public ActionResult Edit([Bind(Include = "myStockId,stock,currentPrice")] MyStocks myStocks) { if (ModelState.IsValid) { db.Entry(myStocks).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(myStocks)); }
public ActionResult Create([Bind(Include = "myStockId,stock,currentPrice,symbol")] MyStocks myStocks) { if (ModelState.IsValid) { db.MyStocks.Add(myStocks); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(myStocks)); }
// GET: MyStocks/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MyStocks myStocks = db.MyStocks.Find(id); if (myStocks == null) { return(HttpNotFound()); } return(View(myStocks)); }