public OperationResult Create(CreateSlide command) { var operation = new OperationResult(); var slide = new Slide(command.Picture, command.PictureAlt, command.PictureTitle, command.Heading, command.Title, command.Text, command.Link, command.BtnText); _slideRepository.Create(slide); _slideRepository.Save(); return(operation.Succeeded()); }
public OperationResult Create(SlideCreate create) { var operation = new OperationResult(); var slide = new Slide(create.Heading, create.Title, create.Text, create.BtnText, create.Picture, create.PictureAlt, create.PictureTitle, create.Link); _slideRepository.Create(slide); _slideRepository.SaveChanges(); return(operation.Success()); }
public OperationResult Create(CreateSlide command) { var operation = new OperationResult(); var picturePath = _fileUploader.Upload(command.Picture, "Slides"); var slide = new Slide(picturePath, command.PictureAlt, command.PictureTitle, command.Heading, command.Title, command.Text, command.BtnText, command.Link); _slideRepository.Create(slide); _slideRepository.SaveChanges(); return(operation.Succeeded()); }