예제 #1
0
 public async Task <IActionResult> PutPateint([FromRoute] int id, [FromBody] Pateint pateint)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState));
     }
     if (id != pateint.PateintId)
     {
         return(BadRequest());
     }
     try
     {
         _repo.Update(pateint);
         var save = await _repo.SaveAsync(pateint);
     }
     catch (DbUpdateConcurrencyException)
     {
         if (!PateintExists(id))
         {
             return(NotFound());
         }
         else
         {
             throw;
         }
     }
     return(NoContent());
 }
예제 #2
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));
        }
예제 #3
0
 public Pateint AddPatient(Pateint patient)
 {
     throw new NotImplementedException();
 }