コード例 #1
0
        public IHttpActionResult PutOther_Information(int id, Other_Information other_Information)
        {
            if (id != other_Information.Information_ID)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
コード例 #2
0
        public IHttpActionResult PostOther_Information(Other_Information other_Information)
        {
            db.Other_Information.Add(other_Information);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = other_Information.Information_ID }, other_Information));
        }
コード例 #3
0
        public IHttpActionResult GetOther_Information(int id)
        {
            Other_Information other_Information = db.Other_Information.Find(id);

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

            return(Ok(other_Information));
        }
コード例 #4
0
        public IHttpActionResult DeleteOther_Information(int id)
        {
            Other_Information other_Information = db.Other_Information.Find(id);

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

            db.Other_Information.Remove(other_Information);
            db.SaveChanges();

            return(Ok(other_Information));
        }