public MagazineViewModel GetMagazine(int id) { var magazineFromDb = _magazineRepository.FindById(id); var magazine = Mapper.Map <Magazine, MagazineViewModel>(magazineFromDb); return(magazine); }
public UserInformation GetUserInformation(int id) { var entities = userRepo.FindById(id); var dtos = _mapper.Map <User, UserInformation>(entities); return(dtos); }
public BrochureViewModel GetBrochure(int id) { var brochureFromDb = _brochureRepository.FindById(id); var brochure = Mapper.Map <Brochure, BrochureViewModel>(brochureFromDb); return(brochure); }
public PublicationHouseViewModel GetPublicationHouse(int id) { var houseFromDb = _houseRepository.FindById(id); var publicationHouse = Mapper.Map <PublicationHouse, PublicationHouseViewModel>(houseFromDb); return(publicationHouse); }
public Customer GetTaskCustomer(int taskId) { int userId = 0; IEnumerable <TaskHistory> history = historyRepo.Get(); foreach (TaskHistory s in history) { if (s.TaskId == taskId) { userId = (int)s.TaskCustomerId; } } var dtos = mapper.Map <User, Customer>(userRepo.FindById(userId)); return(dtos); }
public TaskDescription GetTaskDescription(int id) { var entities = taskRepo.FindById(id); var dtos = mapper.Map <Task, TaskDescription>(entities); return(dtos); }
private void StudentInfo_FormLoad(object sender, EventArgs e) { var student = EFGenericRepository.FindById <Students>(studentInfo.SutdentId); studentInfo.FirstName = student.FirstName; studentInfo.LastName = student.LastName; studentInfo.MiddleName = student.MiddleName; var marks = from s in EFGenericRepository.Get <Students>().Where(st => st.Id == student.Id) join m in EFGenericRepository.Get <Marks>() on s.Id equals m.IdSt select m; studentInfo.GridDataSource = marks.ToList(); }
public ActionResult <User> Get(int id) { User user = userRepo.FindById(id); return(user); }