public async Task <IActionResult> PutPlace(long id, Place place)
        {
            if (id != place.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "PlaceID,Name,Lat,Lng,Rate,Type")] Place place)
 {
     if (ModelState.IsValid)
     {
         db.Entry(place).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(place));
 }
 public ActionResult Edit(Place place)
 {
     if (ModelState.IsValid)
     {
         db.Entry(place).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(place));
 }