예제 #1
0
        public List <Cv> Get(string rootUrl)
        {
            var cvs       = _cvRepository.Get();
            var mappedCvs = _mapper.Map <List <Repositories.Pocos.Cv>, List <Cv> >(cvs);

            mappedCvs.ForEach(o => MapCvUrls(o, rootUrl));
            return(mappedCvs);
        }
예제 #2
0
        public ServiceResponse <UserDTO> GetUserInformation(int id)
        {
            var serviceResponse = new ServiceResponse <UserDTO>();

            var user = _userRepository.Get(x => x.UserId == id);

            if (user == null)
            {
                return(serviceResponse.Error("Kullanıcı Bulunamadı"));
            }
            serviceResponse.Data = _mapper.Map <UserDTO>(user);

            var cv = _cvRepository.Get(x => x.UserId == id);

            if (cv == null)
            {
                return(serviceResponse.Success("Bu Kullanıcının Cv'si Oluşturulmamış"));
            }



            serviceResponse.Data.Cv         = _mapper.Map <CvDTO>(cv);
            serviceResponse.Data.Cv.Socials = new SocialsDTO()
            {
                Facebook  = cv.Facebook,
                Twitter   = cv.Twitter,
                Youtube   = cv.Youtube,
                Instagram = cv.Instagram,
                Linkedin  = cv.Linkedin,
                Medium    = cv.Medium
            };


            serviceResponse.Data.Cv.UserSchools   = _schoolService.GetUserSchools(id).Data;
            serviceResponse.Data.Cv.UserCompanies = _companyService.GetUserCompanies(id).Data;
            serviceResponse.Data.IsCvCreated      = cv != null;

            return(serviceResponse.Success());
        }