Esempio n. 1
0
        public async Task <IHttpActionResult> PutReminderDentistExam(int id, ReminderDentistExam reminderDentistExam)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Esempio n. 2
0
        public async Task <IHttpActionResult> GetReminderDentistExam(int id)
        {
            ReminderDentistExam reminderDentistExam = await db.ReminderDentistExams.FindAsync(id);

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

            return(Ok(reminderDentistExam));
        }
Esempio n. 3
0
        public async Task <IHttpActionResult> PostReminderDentistExam(ReminderDentistExam reminderDentistExam)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.ReminderDentistExams.Add(reminderDentistExam);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = reminderDentistExam.Id }, reminderDentistExam));
        }
Esempio n. 4
0
        public async Task <IHttpActionResult> DeleteReminderDentistExam(int id)
        {
            ReminderDentistExam reminderDentistExam = await db.ReminderDentistExams.FindAsync(id);

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

            db.ReminderDentistExams.Remove(reminderDentistExam);
            await db.SaveChangesAsync();

            return(Ok(reminderDentistExam));
        }