コード例 #1
0
 public async Task <IActionResult> PutRoaster([FromRoute] int id, [FromBody] RoasterOfDoctor roaster)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState));
     }
     if (id != roaster.RoasterOfDoctorId)
     {
         return(BadRequest());
     }
     try
     {
         _repo.Update(roaster);
         var save = await _repo.SaveAsync(roaster);
     }
     catch (DbUpdateConcurrencyException)
     {
         if (!RoasterExists(id))
         {
             return(NotFound());
         }
         else
         {
             throw;
         }
     }
     return(NoContent());
 }
コード例 #2
0
        public async Task <ActionResult> PostPateint([FromBody] Chamber chamber)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            _repo.Add(chamber);
            var save = await _repo.SaveAsync(chamber);

            return(CreatedAtAction("GetChambers", new { id = chamber.ChamberId }, chamber));
        }
コード例 #3
0
        public async Task <ActionResult> PostPateint([FromBody] Pateint pateint)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            _repo.Add(pateint);
            var save = await _repo.SaveAsync(pateint);

            return(CreatedAtAction("GetPateints", new { id = pateint.PateintId }, pateint));
        }
コード例 #4
0
        public async Task <ActionResult> PostDeasisHistories([FromBody] DeasisHistory deasisHistory)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            _repo.Add(deasisHistory);
            var save = await _repo.SaveAsync(deasisHistory);

            return(CreatedAtAction("GetDeasisHistories", new { id = deasisHistory.DeasisHistoryId }, deasisHistory));
        }
コード例 #5
0
        public async Task <ActionResult> PostSpecialization([FromBody] Speacialization specialization)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            _repo.Add(specialization);
            var save = await _repo.SaveAsync(specialization);

            return(CreatedAtAction("GetSpeacializations", new { id = specialization.SpeacializationId }, specialization));
        }
コード例 #6
0
        public async Task <ActionResult> PostDoctors([FromBody] Doctor doctor)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            _repo.Add(doctor);
            var save = await _repo.SaveAsync(doctor);

            return(CreatedAtAction("GetDoctors", new { id = doctor.DoctorId }, doctor));
        }