Пример #1
0
        public IHttpActionResult Putprograminterventiontype(int id, programinterventiontype programinterventiontype)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != programinterventiontype.ID)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Пример #2
0
        public IHttpActionResult Getprograminterventiontype(int id)
        {
            programinterventiontype programinterventiontype = db.programinterventiontypes.Find(id);

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

            return(Ok(programinterventiontype));
        }
Пример #3
0
        public IHttpActionResult Postprograminterventiontype(programinterventiontype programinterventiontype)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.programinterventiontypes.Add(programinterventiontype);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = programinterventiontype.ID }, programinterventiontype));
        }
Пример #4
0
        public IHttpActionResult Deleteprograminterventiontype(int id)
        {
            programinterventiontype programinterventiontype = db.programinterventiontypes.Find(id);

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

            db.programinterventiontypes.Remove(programinterventiontype);
            db.SaveChanges();

            return(Ok(programinterventiontype));
        }