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); }
public PresentationFormViewModel(Presentation presentation) { Title = presentation.Title; Description = presentation.Description; }