/// <summary> /// /// </summary> /// <returns></returns> public override WorkAssignment Get(int id) { var wa = waRepo.GetById(id); if (wa.workerAssignedID != null) { wa.workerAssignedDDD = wRepo.GetById((int)wa.workerAssignedID); } return(wa); }
public async Task <WorkerDTO> GetByIdAsync(long Id) { var result = await _workerRepository.GetById(Id); var worker = _mapper.Map <Worker, WorkerDTO>(result); return(worker); }
public ActionResult Delete(int id) { try{ Worker worker = workerRepository.GetById(id); workRepository.DeleteWorker(id); studentRepository.SaveChanges(); } catch (DataException) { return(RedirectToAction("Delete", new { id = id, saveChangesError = true })); } return(RedirectToAction("Index")); }
public Worker GetById(int id) { return(_repository.GetById(id)); }