示例#1
0
        public ViewResult ApplicationSamples()
        {
            ShowcaseViewModel model = ViewModelFactory.CreateShowcaseViewModel(this.PathHelper, this.TableOfContentsRepository,
                                                                               this.ApplicationSamplesRepository, this.ControlRepository, this.SampleRepository, MemoryCache.Default);

            return(View("ApplicationSamples", model));
        }
        public string ShowcaseLocalInstall()
        {
            ShowcaseViewModel model = ViewModelFactory.CreateShowcaseViewModel(this.PathHelper, this.TableOfContentsRepository,
                                                                               this.ApplicationSamplesRepository, this.ControlRepository, this.SampleRepository, MemoryCache.Default);

            model.LocalZipInstall = true;
            return(ViewRenderer.RenderView("~/Views/Shared/ApplicationSamples.cshtml", model,
                                           ControllerContext));
        }
示例#3
0
        public IActionResult Index(int id)
        {
            var model = new ShowcaseViewModel
            {
                ViewTitle = "Showcase",
                Albums    = _albumService.GetAll().Where(x => x.IsShowcased && x.UserNum == id).ToList(),
                Books     = _bookService.GetAll().Where(x => x.IsShowcased && x.UserNum == id).ToList(),
                Games     = _gameService.GetAll().Where(x => x.IsShowcased && x.UserNum == id).ToList(),
                Movies    = _movieService.GetAll().Where(x => x.IsShowcased && x.UserNum == id).ToList(),
                Pops      = _popService.GetAll().Where(x => x.IsShowcased && x.UserNum == id).ToList()
            };

            return(View(model));
        }
示例#4
0
        public async Task <ValidationResult> UpdateItemAsync(ShowcaseViewModel showcaseViewModel)
        {
            var updateItemCommand = _mapper.Map <UpdateItemCommand>(showcaseViewModel);

            return(await _meditor.SendCommand(updateItemCommand));
        }
示例#5
0
 public async Task <IActionResult> Put([FromBody] ShowcaseViewModel showcaseViewModel)
 {
     return(ModelState.IsValid
         ? ShowcaseResponse(await _showcaseAppService.UpdateItemAsync(showcaseViewModel))
         : ShowcaseResponse(ModelState));
 }