Пример #1
0
        public IHttpActionResult PutD(int id, D d)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != d.Id)
            {
                return(BadRequest());
            }

            db.Entry(d).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!DExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Пример #2
0
 public void Update(Record record)
 {
     db.Entry(record).State = EntityState.Modified;
 }
Пример #3
0
 public void Update(T obj)
 {
     context.Entry(obj).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
     context.SaveChanges();
 }
Пример #4
0
 public void Update(Patient patient)
 {
     db.Entry(patient).State = EntityState.Modified;
 }
Пример #5
0
 public void Update(Doctor doctor)
 {
     db.Entry(doctor).State = EntityState.Modified;
 }
Пример #6
0
 public void Update(Schedule schedule)
 {
     db.Entry(schedule).State = EntityState.Modified;
 }