Beispiel #1
0
        public IHttpActionResult PutG1_N1_Student(int id, G1_N1_Student g1_N1_Student)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != g1_N1_Student.Barcode)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #2
0
        public IHttpActionResult GetG1_N1_Student(int id)
        {
            G1_N1_Student g1_N1_Student = db.G1_N1_Student.Find(id);

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

            return(Ok(g1_N1_Student));
        }
Beispiel #3
0
        public IHttpActionResult DeleteG1_N1_Student(int id)
        {
            G1_N1_Student g1_N1_Student = db.G1_N1_Student.Find(id);

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

            db.G1_N1_Student.Remove(g1_N1_Student);
            db.SaveChanges();

            return(Ok(g1_N1_Student));
        }