public ActionResult Edit(StudentVm model)
        {
            if (ModelState.IsValid)
            {
                _studentVmMapper.SaveViewModel(model);
                _unitOfWork.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(model);
        }
        public Student SaveViewModel(StudentVm model)
        {
            var entity = model.Id > 0
                ? _studentRepository.Find(model.Id)
                : new Student();

            entity.FirstName  = model.FirstName;
            entity.LastName   = model.LastName;
            entity.RowVersion = model.RowVersion;

            return(entity);
        }
        public Student SaveViewModel(StudentVm model)
        {
            var entity = model.Id > 0
                ? _studentRepository.Find(model.Id)
                : new Student();

            entity.FirstName = model.FirstName;
            entity.LastName = model.LastName;
            entity.RowVersion = model.RowVersion;

            return entity;
        }