示例#1
0
        public IHttpActionResult PutKM_file_Comments(long id, KM_file_Comments kM_file_Comments)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != kM_file_Comments.SeqNo)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
示例#2
0
        public IHttpActionResult GetKM_file_Comments(long id)
        {
            KM_file_Comments kM_file_Comments = db.KM_file_Comments.Find(id);

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

            return(Ok(kM_file_Comments));
        }
示例#3
0
        public IHttpActionResult PostKM_file_Comments(KM_file_Comments kM_file_Comments)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.KM_file_Comments.Add(kM_file_Comments);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = kM_file_Comments.SeqNo }, kM_file_Comments));
        }
示例#4
0
        public IHttpActionResult DeleteKM_file_Comments(long id)
        {
            KM_file_Comments kM_file_Comments = db.KM_file_Comments.Find(id);

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

            db.KM_file_Comments.Remove(kM_file_Comments);
            db.SaveChanges();

            return(Ok(kM_file_Comments));
        }