public async Task <ActionResult> Edit([Bind(Include = "PlanId,Category")] Plan plan) { if (ModelState.IsValid) { db.Entry(plan).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(plan)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Name,Price,Size")] Product product) { if (ModelState.IsValid) { db.Entry(product).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(product)); }
public async Task <ActionResult> Edit([Bind(Include = "PartnerId,Name,Address,Country,Description,ImageUrl,Longitude,Latitude")] Partner partner) { if (ModelState.IsValid) { db.Entry(partner).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(partner)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Title,Description,PlanId,PartnerId")] Subscription subscription) { if (ModelState.IsValid) { db.Entry(subscription).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.PartnerId = new SelectList(db.Partners, "PartnerId", "Name", subscription.PartnerId); ViewBag.PlanId = new SelectList(db.Plans, "PlanId", "Category", subscription.PlanId); return(View(subscription)); }
public void Update(T obj) { table.Attach(obj); _context.Entry(obj).State = EntityState.Modified; }