コード例 #1
0
        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());
        }
コード例 #2
0
        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());
        }
コード例 #3
0
        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());
        }