Beispiel #1
0
        public async Task <IActionResult> PutBurger(int id, Burger burger)
        {
            if (id != burger.Id)
            {
                return(BadRequest());
            }

            _context.Entry(burger).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!BurgerExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Beispiel #2
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,Email,FIO,Description")] Contacts contacts)
        {
            if (ModelState.IsValid)
            {
                db.Entry(contacts).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(contacts));
        }
Beispiel #3
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,Name,Description,Price,Rating,DishesTypeId")] Dishes dishes)
        {
            if (ModelState.IsValid)
            {
                db.Entry(dishes).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.DishesTypeId = new SelectList(db.DishesTypes, "Id", "Name", dishes.DishesTypeId);
            return(View(dishes));
        }