Ejemplo n.º 1
0
        public async Task <ActionResult <DoctoresModel> > PostPaymentDetail(DoctoresModel doctorDetail)
        {
            context.Doctores.Add(doctorDetail);
            await context.SaveChangesAsync();

            return(CreatedAtAction("GetPaymentDetail", new { id = doctorDetail.DoctorID }, doctorDetail));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> PutDoctorDetail(int id, DoctoresModel doctor)
        {
            if (id != doctor.DoctorID)
            {
                return(BadRequest());
            }

            context.Entry(doctor).State = EntityState.Modified;

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

            return(NoContent());
        }