public void Update(long id, StudentParam param) { Model.Student oldEntity = Dao.Find(id); if (oldEntity != null) { Dao.Delete(oldEntity); Dao.Update(ParamConverter.Convert(param, null)); } else { Console.WriteLine($"No entity with Id = {id} was found"); } }
public StudentDto Update(StudentDto student) { var entity = ToStudent(student); var result = _studentDao.Update(entity); return(ToStudentDto(result)); }
public void EditStudent(Student student) { studentDao.Update(student); ShowData(studentDao.GetAll()); }