public ActionResult Create([Bind(Include = "ID,Content,CreatedDate,ModifiedDate,ExpiredDate,Status")] Work work) { if (ModelState.IsValid) { work.ID = Guid.NewGuid(); db.Works.Add(work); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(work)); }
public Employee AddEmployee(Employee employee) { _context.Employees.Add(employee); _context.SaveChanges(); return(employee); }