public IHttpActionResult PutClinicTable(int id, ClinicTable clinicTable)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult GetClinicTable(int id)
        {
            ClinicTable clinicTable = db.ClinicTables.Find(id);

            if (clinicTable == null)
            {
                return(NotFound());
            }

            return(Ok(clinicTable));
        }
        public IHttpActionResult PostClinicTable(ClinicTable clinicTable)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.ClinicTables.Add(clinicTable);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = clinicTable.Id }, clinicTable));
        }
Beispiel #4
0
 public void Remove(ClinicTable entity)
 {
     _context.Clinicians.Remove(entity);
 }
Beispiel #5
0
 public void Modify(ClinicTable entity)
 {
     _context.Clinicians.Attach(entity);
     _context.Entry(entity).State = EntityState.Modified;
 }
Beispiel #6
0
 public int Add(ClinicTable entity)
 {
     _context.Clinicians.Add(entity);
     return(entity.Identifier);
 }
Beispiel #7
0
 public void Remove(ClinicTable entity)
 {
     _repo.Remove(entity);
 }
Beispiel #8
0
 public void Modify(ClinicTable entity)
 {
     _repo.Modify(entity);
 }
Beispiel #9
0
 public int Add(ClinicTable entity)
 {
     return(_repo.Add(entity));
 }