Ejemplo n.º 1
0
        public async Task <ActionResult> Details(Guid id)
        {
            var objective = await _objectivesRepository.GetObjectiveById(id);

            var model = new ObjectiveViewModel
            {
                Id         = objective.Id,
                Title      = objective.Title,
                Created    = objective.Created,
                KeyResults = objective.KeyResults.Select(y => new KeyResultListItemViewModel {
                    Id = y.Id, Description = y.Description
                }).ToList()
            };

            return(View(model));
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> Details(Guid objectiveId, Guid keyResultId)
        {
            var objective = await _objectivesRepository.GetObjectiveById(objectiveId);

            var keyResult = objective.KeyResults.Single(x => x.Id == keyResultId);

            var model = new KeyResultDetailsViewModel
            {
                ObjectiveTitle = objective.Title,
                Description    = keyResult.Description,
                Id             = keyResult.Id,
                ObjectiveId    = objective.Id,
                Created        = objective.Created
            };

            return(View(model));
        }