예제 #1
0
        public IHttpActionResult PuttblM_User_data(int id, tblM_User_data tblM_User_data)
        {
            if (id != tblM_User_data.UserId)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
예제 #2
0
        public IHttpActionResult PosttblM_User_data(tblM_User_data tblM_User_data)
        {
            db.tblM_User_data.Add(tblM_User_data);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = tblM_User_data.UserId }, tblM_User_data));
        }
예제 #3
0
        public IHttpActionResult GettblM_User_data(int id)
        {
            tblM_User_data tblM_User_data = db.tblM_User_data.Find(id);

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

            return(Ok(tblM_User_data));
        }
예제 #4
0
        public IHttpActionResult DeletetblM_User_data(int id)
        {
            tblM_User_data tblM_User_data = db.tblM_User_data.Find(id);

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

            db.tblM_User_data.Remove(tblM_User_data);
            db.SaveChanges();

            return(Ok(tblM_User_data));
        }