Пример #1
0
        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));
        }
Пример #2
0
 public Employee AddEmployee(Employee employee)
 {
     _context.Employees.Add(employee);
     _context.SaveChanges();
     return(employee);
 }