public IActionResult Edit(Data.Lesson model) { model.date_modified = DateTime.Now; db.Entry(model).State = Microsoft.EntityFrameworkCore.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); }
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")); }