public IActionResult PostComp(string name) { var comp = new Comp() { comp_Name = name }; _context.Add(comp); _context.SaveChanges(); return(Ok("Created")); }
public ActionResult Create(Computer comp) { if (ModelState.IsValid) { db.Computers.Add(comp); db.SaveChanges(); return(RedirectToAction("Index")); } return(View("Index")); }
public void Save() { db.SaveChanges(); }