コード例 #1
0
        public MagazineViewModel GetMagazine(int id)
        {
            var magazineFromDb = _magazineRepository.FindById(id);
            var magazine       = Mapper.Map <Magazine, MagazineViewModel>(magazineFromDb);

            return(magazine);
        }
コード例 #2
0
        public UserInformation GetUserInformation(int id)
        {
            var entities = userRepo.FindById(id);
            var dtos     = _mapper.Map <User, UserInformation>(entities);

            return(dtos);
        }
コード例 #3
0
ファイル: BrochureService.cs プロジェクト: AlexBudkoc/Library
        public BrochureViewModel GetBrochure(int id)
        {
            var brochureFromDb = _brochureRepository.FindById(id);
            var brochure       = Mapper.Map <Brochure, BrochureViewModel>(brochureFromDb);

            return(brochure);
        }
コード例 #4
0
        public PublicationHouseViewModel GetPublicationHouse(int id)
        {
            var houseFromDb      = _houseRepository.FindById(id);
            var publicationHouse = Mapper.Map <PublicationHouse, PublicationHouseViewModel>(houseFromDb);

            return(publicationHouse);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        public TaskDescription GetTaskDescription(int id)
        {
            var entities = taskRepo.FindById(id);
            var dtos     = mapper.Map <Task, TaskDescription>(entities);

            return(dtos);
        }
コード例 #7
0
        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();
        }
コード例 #8
0
        public ActionResult <User> Get(int id)
        {
            User user = userRepo.FindById(id);

            return(user);
        }