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

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

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