Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "Id,AppointmentDate,Description")] Appointments appointments)
 {
     if (ModelState.IsValid)
     {
         db.Entry(appointments).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(appointments));
 }
Ejemplo n.º 2
0
        public async Task <IActionResult> PutDataModel(string id, DataPlanner dataPlanner)
        {
            if (id != dataPlanner.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }