public async Task <IActionResult> CreatePost(PresentationProfilesCreateViewModel model) { //if (!await _authorizationService.AuthorizeAsync(User, Permissions.ManageQueries)) //{ // return Unauthorized(); //} var presentationprofile = _slideShowEngines.FirstOrDefault(x => x.Name == model.SourceName)?.Create(); presentationprofile.Id = Guid.NewGuid().ToString("N"); var editor = await _displayManager.UpdateEditorAsync(presentationprofile, updater : this, isNew : true); if (ModelState.IsValid) { await _presentatinProfileManager.SavePresentationProfileAsync(presentationprofile.Name, presentationprofile); _notifier.Success(H["Profile created successfully"]); return(RedirectToAction("Profiles")); } // If we got this far, something failed, redisplay form model.Editor = editor; return(View(model)); }
public async Task <IActionResult> Create(string id) { //if (!await _authorizationService.AuthorizeAsync(User, Permissions.ManageQueries)) //{ // return Unauthorized(); //} var presentationprofile = _slideShowEngines.FirstOrDefault(x => x.Name == id)?.Create(); if (presentationprofile == null) { return(NotFound()); } var model = new PresentationProfilesCreateViewModel { Editor = await _displayManager.BuildEditorAsync(presentationprofile, updater : this, isNew : true), SourceName = id }; return(View(model)); }