コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        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));
        }
コード例 #5
0
 public void Update(T obj)
 {
     table.Attach(obj);
     _context.Entry(obj).State = EntityState.Modified;
 }