コード例 #1
0
        // POST: api/Managercomments
        public void Post([FromBody] Managercomments value)
        {
            ProjectdbContext db = new ProjectdbContext();

            db.Mcom.Add(value);
            db.SaveChanges();
        }
コード例 #2
0
        // PUT: api/Managercomments/5
        public void Put(int id, [FromBody] Managercomments value)
        {
            ProjectdbContext db  = new ProjectdbContext();
            Managercomments  com = db.Mcom.Where(emp => emp.Commission == id).FirstOrDefault();

            if (com != null)
            {
                com.Comments = value.Comments;
                com.Pid      = value.Pid;
                db.SaveChanges();
            }
        }