Пример #1
0
        public async Task <ActionResult> CreateForUser(CreateObjectiveFormModel model)
        {
            var objective = new Objective(model.Title, model.UserId);
            await _objectivesRepository.CreateObjective(objective);

            return(RedirectToAction(nameof(Details), new { id = objective.Id }));
        }
Пример #2
0
        public async Task <ActionResult> Create(CreateObjectiveFormModel model)
        {
            var user = await _currentContext.GetCurrentUser();

            var objective = new Objective(model.Title, user.UserId);
            await _objectivesRepository.CreateObjective(objective);

            return(RedirectToAction(nameof(Details), new { id = objective.Id }));
        }