예제 #1
0
        public IActionResult All()
        {
            var defaultCvId = _cvService.GetId();
            var viewModel   = new AllCommentsViewModel
            {
                Comments   = _commentsService.GetAll <CommentViewModel>(defaultCvId),
                InputModel = new CommentCreateInputModel()
            };

            return(View(viewModel));
        }
예제 #2
0
        public async Task <IActionResult> Create(EducationCreateInputModel input)
        {
            var defaultCvId = _cvService.GetId();

            if (!ModelState.IsValid)
            {
                return(View(input));
            }

            try
            {
                await _educationService.CreateAsync(input, defaultCvId);
            }
            catch (Exception e)
            {
                _logger.LogError(e, "An exception occured during new education record creation.");
                return(RedirectToAction("Error", "Home"));
            }

            return(RedirectToAction("Index", "Home"));
        }