示例#1
0
        public IHttpActionResult PutLogsT(int id, LogsT logsT)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != logsT.id_log)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
示例#2
0
        public IHttpActionResult GetLogsT(int id)
        {
            LogsT logsT = db.LogsT.Find(id);

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

            return(Ok(logsT));
        }
示例#3
0
        public IHttpActionResult PostLogsT(LogsT logsT)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.LogsT.Add(logsT);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = logsT.id_log }, logsT));
        }
示例#4
0
        public IHttpActionResult DeleteLogsT(int id)
        {
            LogsT logsT = db.LogsT.Find(id);

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

            db.LogsT.Remove(logsT);
            db.SaveChanges();

            return(Ok(logsT));
        }