コード例 #1
0
        public ActionResult Create(PresentationFormViewModel presentationForm)
        {
            if(ModelState.IsValid)
            {
                var presentation = new Presentation(presentationForm.Title, presentationForm.Description);
                commandHandler
                    .Add(new FilePresentationCommand(presentationForm.PresentationFile))
                    .Add(new ConvertPresentationCommand())
                    .Process(presentation, (returns) => presentation.QtdSlides = returns.Last());

                presentations.Add(presentation);

                return RedirectToAction("Details", new{ id = presentation.Id });
            }
            return View(presentationForm);
        }
コード例 #2
0
 public PresentationFormViewModel(Presentation presentation)
 {
     Title = presentation.Title;
     Description = presentation.Description;
 }