예제 #1
0
 public IActionResult Edit(Data.Lesson model)
 {
     model.date_modified   = DateTime.Now;
     db.Entry(model).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
예제 #2
0
 public IActionResult Add(Data.Lesson model)
 {
     model.date_created  = DateTime.Now;
     model.date_modified = DateTime.Now;
     model.deleted       = 0;
     model.keywords      = "";
     db.lessons.Add(model);
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }