コード例 #1
0
        public async Task <IActionResult> Create([Bind("Title,ShortDescription,LongDescription,Tags")] PresentationViewModel presentationViewModel)
        {
            if (ModelState.IsValid)
            {
                var currentSpeaker = await _speakerRepository.GetSpeakerBySpeakerEmailAsync(HttpContext.User.Identity.Name);

                var presentationTag = _presentationViewModelMapper.MapToPresentationTag(presentationViewModel, currentSpeaker);
                await _presentationManager.AddPresentation(presentationTag);

                //_context.Add(presentation);
                //await _context.SaveChangesAsync();
                return(RedirectToAction(nameof(Index)));
            }
            //return View(presentation);
            return(View());
        }