Пример #1
0
        //public Task<IQueryable<JobCategoryViewModel>> getCategoriesByUserId(string id)
        //{
        //    IQueryable<ArticleViewModel> query1;
        //    var alist = await _articleRepository.getArticlesByUserId(id);
        //    query1 = alist.ProjectTo<ArticleViewModel>(_mapper.ConfigurationProvider);
        //    return query1;
        //}



        //getting JobCategory with all JobPost by ID into 1 layer using specification
        public async Task <JobCategoryViewModel> GetJobCategoryWithJobPostById(int id)
        {
            var alist = await _jobCategoryRepository.getJobCategoryWithJobPostById(id);

            var mapped = _mapper.Map <JobCategoryViewModel>(alist);

            return(mapped);
        }