コード例 #1
0
        public IActionResult UpdateStudnet(Student request)
        {
            var db = new s19191Context();

            db.Attach(request);
            db.Entry(request).State = EntityState.Modified;
            db.SaveChanges();
            return(Ok("Student zmodyfikowany"));
        }
コード例 #2
0
        public IActionResult DeleteStudnet(string Index)
        {
            var db = new s19191Context();
            var s  = new Student
            {
                IndexNumber = Index
            };

            db.Attach(s);
            db.Student.Remove(s);
            db.SaveChanges();
            return(Ok("Studnet usunięty z bazy"));
        }