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());
        }
Example #2
0
        public IActionResult OnPostCreate(CreateSlide command)
        {
            var operationResult = new OperationResult();

            if (ModelState.IsValid)
            {
                operationResult = _slideApplication.Create(command);
            }
            return(new JsonResult(operationResult));
        }
        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());
        }
Example #4
0
        public OperationResult Create(CreateSlide command)
        {
            OperationResult operationResult = new OperationResult();

            var Path        = "Slides";
            var picturePath = _fileUploader.Upload(command.Picture, Path);
            var slide       = new Slide(picturePath, command.PictureAlt, command.PictureTitle, command.Heading, command.Title, command.Text,
                                        command.link, command.btnText);

            _slideRepo.Create(slide);
            _slideRepo.Save();
            return(operationResult.Succeeded());
        }
        public JsonResult OnPostCreate(CreateSlide command)
        {
            var result = _slideApplication.Create(command);

            return(new JsonResult(result));
        }
        public IActionResult OnGetCreate()
        {
            var command = new CreateSlide();

            return(Partial("./Create", command));
        }