Exemple #1
0
        // GET: Work
        public async Task <ActionResult> Index()
        {
            var aspNetUser = await _aspNetUserRepository.GetByIdAsync(User.Identity.GetUserId());

            if (aspNetUser == null)
            {
                return(HttpNotFound());
            }

            var works = await _workRepository.GetAllByUserAsync(User.Identity.GetUserId());

            var projects = await _projectRepository.GetAllAsync();

            WorkListViewModel viewModel = Mapper.Map <IEnumerable <Work>, WorkListViewModel>(works)
                                          .Map(projects);

            return(View(viewModel));
        }