Beispiel #1
0
        public IActionResult PostComp(string name)
        {
            var comp = new Comp()
            {
                comp_Name = name
            };

            _context.Add(comp);
            _context.SaveChanges();
            return(Ok("Created"));
        }
Beispiel #2
0
        public ActionResult Create(Computer comp)
        {
            if (ModelState.IsValid)
            {
                db.Computers.Add(comp);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View("Index"));
        }
Beispiel #3
0
 public void Save()
 {
     db.SaveChanges();
 }