public bool Update(DeThi entity) { var tan = tn.DeThis.Find(entity.MaDe); tan.MoTa = entity.MoTa; tan.MaMon = entity.MaMon; tan.LoaiDe = entity.LoaiDe; tan.MaxQuiz = entity.MaxQuiz; tan.Status = entity.Status; tan.Time = entity.Time; tan.Audio = entity.Audio; tan.Password = entity.Password; tn.SaveChanges(); return(true); }
public int Insert(DeThi entity) { tn.DeThis.Add(entity); tn.SaveChanges(); return(entity.MaDe); }